angular-off

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

npm install angular-off
6 downloads in the last month

angular-off Build Status

angular.module('controllers', [])
  .controller('MainCtrl', function() {

    $scope.$on('$routeChangeError', function(event, current, prevous, rejection) {
      alert('Filed to change routes!');
    });

    $scope.button = function() {
     $scope.$off('$routeChangeError');
    };

  });
npm loves you