angular-off

Providing the method $off for $rootScope in Angular.js

angular-off

angular.module('controllers', [])
  .controller('MainCtrl', function() {
 
    $scope.$on('$routeChangeError', function(eventcurrentprevousrejection) {
      alert('Filed to change routes!');
    });
 
    $scope.button = function() {
     $scope.$off('$routeChangeError');
    };
 
  });