events-wrapper
v1.0.0
Published
simple javascript events handler
Downloads
12
Readme
jsTools: Events
Installation
npm install events-wrapper --save
# alternatively you can use bower (minified version by default)
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');
}]);