Angular: $scope.$on() – listen to several events

I found it quite strange that AngularJS does not have possibility to watch several Angular-events, i.e.:

$scope.$on(['user.login', 'user.logout'], callback);

and I decided to extend $on method, to make it handle such case:

  var $onOrigin = $rootScope.$on;
  $rootScope.$on = function(names, listener) {
    var self = this;

    if (!angular.isArray(names)) {
      names = [names];

    names.forEach(function(name) {
      $, name, listener);


Sandbox for this code you can find here.