Providing the method $off for $rootScope in Angular.js
JavaScript
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
test
.gitignore
.jshintrc
.travis.yml
Gruntfile.js
LICENSE
README.md
angular-off.js
bower.json
package.json

README.md

angular-off Build Status

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

#How do I add this to my project?

You can download angular-off by:

<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.2.10/angular.min.js"></script>
<script src="app/bower_components/angular-off/angular-off.js"></script>
<script>
  angular.module('YOUR_APP', [
    'controllers'
  ]);

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

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

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

    });
</script>