code: function (eventType, listener, listenerScope) {
                  var deregisterFn;
  
                  if (typeof listener === 'function') {
                      deregisterFn = $rootScope.$on(eventType, function () {
                          listener.apply({}, Array.prototype.slice.call(arguments, 1));
                      });
                  } else if (typeof listener === 'object') {
                      deregisterFn = $rootScope.$on(eventType, function () {
                          $injector.invoke(listener, {}, {
                              $event: arguments[0],
                              $args: Array.prototype.slice.call(arguments, 1)
                          });
                      });
                  } else {
                      throw new Error('event listener must be a function or an injection array, got ' + typeof listener);
                  }
  
                  if (listenerScope === 'view') {
                      viewListeners.push(deregisterFn);
                  }
  
                  return deregisterFn;
              }
docs: @ngdoc function
  @name w20CoreEnv.service:EventService#on
  @methodOf w20CoreEnv.service:EventService
  @param {String} eventType The type of the event.
  @param {String} listener A function that will be called upon event reception.
  @param {String} listenerScope The scope of the listener.
  @returns {Function} The listener unregistration function.
  
  @description
  
  Register a listener for a given type of event. Listeners have a scope :
  * Application scope (by default or 'application' as the listenerScope argument). The listener will live for the duration of the application. No automatic deregistration will be done.
  * View scope ('view' as listenerScope argument). The listener will live for the duration of the current view. On view change, it will be automatically deregistered.