Skip to content

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

Notifications You must be signed in to change notification settings

FronterAS/angular-off

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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:

  • Using bower and running bower install angular-off --save This is a very old version it seems.
  • Using npm and running npm install angular-off --save
  • Adding this repo to your bower.json file
  • Downloading it manually by clicking here to download development unminified version
<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>

About

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

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%