https://github.com/nebo15/angular-event-manager
Event Manager for Angular JS apps
https://github.com/nebo15/angular-event-manager
angular event frontend javascript
Last synced: 2 months ago
JSON representation
Event Manager for Angular JS apps
- Host: GitHub
- URL: https://github.com/nebo15/angular-event-manager
- Owner: Nebo15
- Created: 2016-04-21T09:17:55.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2017-03-12T09:50:21.000Z (over 9 years ago)
- Last Synced: 2025-02-18T00:06:18.187Z (over 1 year ago)
- Topics: angular, event, frontend, javascript
- Size: 4.88 KB
- Stars: 0
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Angular Event Manager
Event Manager for Angular JS apps.
It's simple implementation of event manager. You can use it for simplify tracking events in your app in single object and then send event to the several external services.
## How to install
Install as Bower package
```
bower install angular-event-manager --save
```
Add module to angular module ap
```
angular.module('app', [
...,
'eventManager'
]);
```
### Example
```
// tracking event
angular.module('app').controller('AppController', function ($scope, EventManager) {
EventManager.track('AppControlerOpen', {data: 'example'});
});
// subscribe to event
angular.module('app').run(function (EventManager, $mixpanel) {
EventManager.subscribe(['AppControlerOpen'], function (eventName, data) {
// you can track here event for external services
// eg, $mixpanel.track(eventName);
});
EventManager.subscribeAll(function (name, data) {
// receive all events
});
EventManager.unsubscribe(['Event1', 'Event2'], function () {});
EventManager.unsubscribeAll(function () {});
});
```