Angular-pusher bridge
This library is an open source angular bridge to the Pusher.
Usage overview
Installation
Bower
bower install angular-pusher-bridge
and then
NPM
npm install angular-pusher-bridge
and then
Configuration
The service provider provides the following methods:
.setApiKey('KEY')
- set pusher application key;.option(name, value)
or.option({name: value})
- Configuring the pusher's client. Available pusher options;.subscribe(channel)
- subscribe to the channel events;.alias(channel, alias)
or.alias({channel: alias})
- set alias for channel
These methods are available during configuration through pusherProvider. At run time, the following methods are changing their behavior:
.option(name)
- return pusher's option value;
Enable debugging
.option('debug', true)
- enable logging (via $log) all events (default: false)
Debounce $digest
.option('debounce', int)
- enable debounce $rootScope.$digest. Run $digest after 'milliseconds' (default: 50)
Binding to events
This module is designed for integration events received through the pusher, into the system event angular. Events propagate from $rootScope.
$scope;
or
$scope;
If the channel has been set an alias, the name of the event instead of the name of the channel will be used an alias:
pusherProvider;$scope;
Examples
angular