Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Providing the method $off for $rootScope in Angular.js
JavaScript
branch: master
Failed to load latest commit information.
test init tests
.gitignore add .gitignore
.jshintrc add .jshintrc
.travis.yml add .travis.yml
Gruntfile.js add Gruntfile.js
LICENSE Create LICENSE
README.md Updated README.md to match this project
angular-off.js update source code
bower.json add bower.json
package.json update package

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>
Something went wrong with that request. Please try again.