ng-once
v0.3.0
Published
Adds $rootScope functionality to handle an event only once
Downloads
12
Maintainers
Readme
ng-once
ng-once is a module that introduces $rootScope.$once
. This allows an event handler to
be bound to an event, but it will be invoked only once.
Installation
Bower
$ bower install ng-once --save
npm
$ npm install ng-once
Usage
angular.module('demo').controller('DemoCtrl', function ($rootScope) {
$rootScope.$once('$routeChangeSuccess', function () {
// This function will be invoked on only the first $routeChangeSuccess
});
});