docs: function registerListeners(scope, listeners) {
          var fns = [];
  
          for (var name in listeners) {
              if (listeners.hasOwnProperty(name) && listeners[name]) {
                  fns.push(eventBus.on(name, $injector.invoke(listeners[name])));
              }
          }
  
          // make sure handlers are destroyed along with scope
          scope.$on('$destroy', function () {
              for (var i = 0; i < fns.length; i++) {
                  fns[i]();
              }
          });
      }