ng-once

0.3.0 • Public • Published

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
    });
});

Package Sidebar

Install

npm i ng-once

Weekly Downloads

1

Version

0.3.0

License

MIT

Last publish

Collaborators

  • nsand