jsTools: Events
Installation
npm install events-wrapper --save
bower install events-wrapper --save
Usage
var obj = new Events();
obj.on('foo', function () {
flag = true;
});
obj.trigger('foo');
AngularJS Module
angular.module('myApp', ['jstools.events'])
.controller('AppCtrl', ['$scope', 'Events', function ($scope, Events) {
var obj = new Events();
obj.$$on('foo', function () {
flag = true;
});
obj.$$trigger('foo');
}]);