https://github.com/patrickjs/angular-off
Providing the method $off for $rootScope in Angular.js
https://github.com/patrickjs/angular-off
Last synced: 15 days ago
JSON representation
Providing the method $off for $rootScope in Angular.js
- Host: GitHub
- URL: https://github.com/patrickjs/angular-off
- Owner: PatrickJS
- License: mit
- Created: 2013-09-26T07:44:12.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2014-09-26T17:56:44.000Z (over 11 years ago)
- Last Synced: 2025-10-03T16:18:42.766Z (3 months ago)
- Language: JavaScript
- Homepage:
- Size: 165 KB
- Stars: 10
- Watchers: 2
- Forks: 6
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# angular-off [](https://travis-ci.org/gdi2290/angular-off)
Providing the method $off for $rootScope in Angular.js
#How do I add this to my project?
You can download angular-off by:
* (prefered) Using bower and running `bower install angular-off --save`
* Using npm and running `npm install angular-off --save`
* Downloading it manually by clicking [here to download development unminified version](https://raw.github.com/gdi2290/angular-off/master/angular-off.js)
````html
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);
};
});
````