{"_id":"pusher-angular","_rev":"24-b88de0ed8f931cb812376f84544fe23f","name":"pusher-angular","dist-tags":{"latest":"1.0.0"},"versions":{"0.1.4":{"name":"pusher-angular","version":"0.1.4","keywords":["pusher","angular","websockets"],"author":{"name":"Hamilton Chapman"},"license":"MIT","_id":"pusher-angular@0.1.4","maintainers":[{"name":"hamchapman","email":"hamchapman@gmail.com"}],"homepage":"https://github.com/pusher/pusher-angular","bugs":{"url":"https://github.com/pusher/pusher-angular/issues"},"dist":{"shasum":"95501932a00528f5c09d349cf74f4dba4b62634f","tarball":"https://registry.npmjs.org/pusher-angular/-/pusher-angular-0.1.4.tgz","integrity":"sha512-XeOEPEeUT5TogSLAcjKjbX+Wea0wO23iPf7HtRLo9PTc/+NzVIn9H3mu4q2bkOzZlww6wHaSxpcLYRqAAM33mQ==","signatures":[{"sig":"MEYCIQCKH00FRwHu+NYNFPYK0B6+56s9/iYUCFVSqR6twhHB/wIhAIndMhMPfThnFyxNBeejNlke9AAB0NcEu2OcXVKgFQlP","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"lib/pusher-angular.min.js","_from":".","_shasum":"95501932a00528f5c09d349cf74f4dba4b62634f","gitHead":"9970bed853d9ab39e7f2b23882d06a16d0bc6036","scripts":{"test":"karma start traivs_karma.conf.js"},"_npmUser":{"name":"hamchapman","email":"hamchapman@gmail.com"},"repository":{"url":"https://github.com/pusher/pusher-angular.git","type":"git"},"_npmVersion":"2.1.9","description":"Angular library for using Pusher","directories":{},"_nodeVersion":"0.10.33","devDependencies":{"karma":"^0.12.24","istanbul":"^0.3.2","coveralls":"^2.11.2","karma-cli":"0.0.4","karma-jasmine":"^0.2.2","karma-coverage":"^0.2.6","karma-spec-reporter":"0.0.13","karma-chrome-launcher":"^0.1.5","karma-firefox-launcher":"^0.1.3","karma-phantomjs-launcher":"^0.1.4"}},"0.1.5":{"name":"pusher-angular","version":"0.1.5","keywords":["pusher","angular","websockets"],"author":{"name":"Hamilton Chapman"},"license":"MIT","_id":"pusher-angular@0.1.5","maintainers":[{"name":"hamchapman","email":"hamchapman@gmail.com"}],"homepage":"https://github.com/pusher/pusher-angular","bugs":{"url":"https://github.com/pusher/pusher-angular/issues"},"dist":{"shasum":"02a7f25ab1ef4a4900fbf424d2aacb2430d48d4e","tarball":"https://registry.npmjs.org/pusher-angular/-/pusher-angular-0.1.5.tgz","integrity":"sha512-RL8eiwpv2LdLJ0+LVQ77vMsDayJLn2Fp6idij80M3DDMFxlNwOJSA8F50gQRFCA/Wg80WJWaguNXKvRwrQmRMA==","signatures":[{"sig":"MEQCIGibcB2DHCeAq8zG62Dn8mad7/ebuhcaMvbmMKl0izBxAiAK4YLDTisGxdhnWclw5CBTZrdBDpEIFupTjB1rTJlDbg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"lib/pusher-angular.js","_from":".","_shasum":"02a7f25ab1ef4a4900fbf424d2aacb2430d48d4e","gitHead":"3dafc2e2f399c604f211038fe36e1debf4e7ded5","scripts":{"test":"karma start traivs_karma.conf.js"},"_npmUser":{"name":"hamchapman","email":"hamchapman@gmail.com"},"repository":{"url":"https://github.com/pusher/pusher-angular.git","type":"git"},"_npmVersion":"2.1.9","description":"Angular library for using Pusher","directories":{},"_nodeVersion":"0.10.33","devDependencies":{"karma":"^0.12.24","istanbul":"^0.3.2","coveralls":"^2.11.2","karma-cli":"0.0.4","karma-jasmine":"^0.2.2","karma-coverage":"^0.2.6","karma-spec-reporter":"0.0.13","karma-chrome-launcher":"^0.1.5","karma-firefox-launcher":"^0.1.3","karma-phantomjs-launcher":"^0.1.4"}},"0.1.6":{"name":"pusher-angular","version":"0.1.6","keywords":["pusher","angular","websockets"],"author":{"name":"Hamilton Chapman"},"license":"MIT","_id":"pusher-angular@0.1.6","maintainers":[{"name":"hamchapman","email":"hamchapman@gmail.com"}],"homepage":"https://github.com/pusher/pusher-angular","bugs":{"url":"https://github.com/pusher/pusher-angular/issues"},"dist":{"shasum":"a49cfdcc2723b71bc56337ad79c46e8b899df187","tarball":"https://registry.npmjs.org/pusher-angular/-/pusher-angular-0.1.6.tgz","integrity":"sha512-hdGidhoJ4yODc9qafsEj0eCScgUN0sGDJ7MbUGELZAz+tQw0vmxIPSDxcntCSJgGi50XQP1D1g5tNa0xAgYUTw==","signatures":[{"sig":"MEUCIHgbMaI50BxJUQYxBy3+CBFsAt6nYRw7bZjxPLsiRChuAiEAzhfqJ9pDNs3cr5DCrJ3mkjFEoLMF4QXCBgUUM3gNNLE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"lib/pusher-angular.js","_from":".","_shasum":"a49cfdcc2723b71bc56337ad79c46e8b899df187","gitHead":"4e5471ec61361f64d3d3efa9a73d3d505000aaa8","scripts":{"test":"karma start travis_karma.conf.js"},"_npmUser":{"name":"hamchapman","email":"hamchapman@gmail.com"},"repository":{"url":"https://github.com/pusher/pusher-angular.git","type":"git"},"_npmVersion":"2.1.9","description":"Angular library for using Pusher","directories":{},"_nodeVersion":"0.10.33","devDependencies":{"karma":"^0.12.24","istanbul":"^0.3.2","coveralls":"^2.11.2","karma-cli":"0.0.4","karma-jasmine":"^0.2.2","karma-coverage":"^0.2.6","karma-spec-reporter":"0.0.13","karma-chrome-launcher":"^0.1.5","karma-firefox-launcher":"^0.1.3","karma-phantomjs-launcher":"^0.1.4"}},"0.1.7":{"name":"pusher-angular","version":"0.1.7","keywords":["pusher","angular","websockets"],"author":{"name":"Hamilton Chapman"},"license":"MIT","_id":"pusher-angular@0.1.7","maintainers":[{"name":"hamchapman","email":"hamchapman@gmail.com"}],"homepage":"https://github.com/pusher/pusher-angular","bugs":{"url":"https://github.com/pusher/pusher-angular/issues"},"dist":{"shasum":"3df1179486bcde890788b597e606b5d0ea3f6de3","tarball":"https://registry.npmjs.org/pusher-angular/-/pusher-angular-0.1.7.tgz","integrity":"sha512-OLdgS2gr40GAVz0gw9XncREPAWE7z3Ek2qnPg9HXYlF3XgnHlSI5mSlPJ05hrj71TiRNDH9vGL5ByfquI2Bh9w==","signatures":[{"sig":"MEYCIQDoaI1r8+FbkrH/DRs1WQiwQ984PueSu9WuR6Nn2m/XvgIhAJ2UQkdfx0lZZKkNS/aC+Bt3f/4bmx/S9jZ2kdBTjCjQ","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"lib/pusher-angular.js","_from":".","_shasum":"3df1179486bcde890788b597e606b5d0ea3f6de3","gitHead":"9190ff23ff7500fac5bb173d08f43575e92071ed","scripts":{"test":"karma start travis_karma.conf.js"},"_npmUser":{"name":"hamchapman","email":"hamchapman@gmail.com"},"repository":{"url":"git+https://github.com/pusher/pusher-angular.git","type":"git"},"_npmVersion":"2.14.2","description":"Angular library for using Pusher","directories":{},"_nodeVersion":"0.12.7","devDependencies":{"karma":"^0.12.24","istanbul":"^0.3.2","coveralls":"^2.11.2","karma-cli":"0.0.4","uglify-js":"latest","karma-jasmine":"^0.2.2","karma-coverage":"^0.2.6","karma-spec-reporter":"0.0.13","karma-chrome-launcher":"^0.1.5","karma-firefox-launcher":"^0.1.3","karma-phantomjs-launcher":"^0.1.4"}},"0.1.8":{"name":"pusher-angular","version":"0.1.8","keywords":["pusher","angular","websockets"],"author":{"name":"Hamilton Chapman"},"license":"MIT","_id":"pusher-angular@0.1.8","maintainers":[{"name":"hamchapman","email":"hamchapman@gmail.com"}],"homepage":"https://github.com/pusher/pusher-angular","bugs":{"url":"https://github.com/pusher/pusher-angular/issues"},"dist":{"shasum":"788c3824956079139520fe43c4047079e373aa8b","tarball":"https://registry.npmjs.org/pusher-angular/-/pusher-angular-0.1.8.tgz","integrity":"sha512-xYtH+IBoY7XmCf4960Ottv5f/URE+D4b+9boS+XkZfU040Wr3FfVHjGU9wIt6cOoxBsnGAxWYfEBKj5qR0NS6g==","signatures":[{"sig":"MEUCIQCV6wFUPlOv34DcyPR8kAopkckpeEs5aeQnBul5QzMcEgIgECi3d5ZBm2alwHTwEjkdknznMY+Pbxz0/wUM9w5e+2Q=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"lib/pusher-angular.js","_from":".","_shasum":"788c3824956079139520fe43c4047079e373aa8b","gitHead":"96a8173bdbbbc62e25f7e05701422bca48948e6e","scripts":{"test":"karma start travis_karma.conf.js"},"_npmUser":{"name":"hamchapman","email":"hamchapman@gmail.com"},"repository":{"url":"git+https://github.com/pusher/pusher-angular.git","type":"git"},"_npmVersion":"2.14.2","description":"Angular library for using Pusher","directories":{},"_nodeVersion":"0.12.7","devDependencies":{"karma":"^0.12.24","istanbul":"^0.3.2","coveralls":"^2.11.2","karma-cli":"0.0.4","uglify-js":"latest","karma-jasmine":"^0.2.2","karma-coverage":"^0.2.6","karma-spec-reporter":"0.0.13","karma-chrome-launcher":"^0.1.5","karma-firefox-launcher":"^0.1.3","karma-phantomjs-launcher":"^0.1.4"}},"0.1.9":{"name":"pusher-angular","version":"0.1.9","keywords":["pusher","angular","websockets"],"author":{"name":"Hamilton Chapman"},"license":"MIT","_id":"pusher-angular@0.1.9","maintainers":[{"name":"hamchapman","email":"hamchapman@gmail.com"}],"homepage":"https://github.com/pusher/pusher-angular","bugs":{"url":"https://github.com/pusher/pusher-angular/issues"},"dist":{"shasum":"c310660fe577205b99fb2569c68888dfbfcaaa1c","tarball":"https://registry.npmjs.org/pusher-angular/-/pusher-angular-0.1.9.tgz","integrity":"sha512-ua178Eg5xWdo3ObIhEFcsaE7MzQIWtTUmyzlOIBThKx6sOmDbzT5Vl1lWP5LbA3CjRycXS0+l9lzIDghHmmAoA==","signatures":[{"sig":"MEUCID4vmNzGLNMjXrIqn/nf7vhRShsEmxjzq0K1rT9YXMlnAiEA3mhhSNsUIT2sSB6wTRft0vHhAm5q117mpIRLHQYp/w4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"lib/pusher-angular.js","_from":".","_shasum":"c310660fe577205b99fb2569c68888dfbfcaaa1c","gitHead":"1d7ac875ab6d12d1d08f111d8ee7c2cfc2233eac","scripts":{"test":"karma start travis_karma.conf.js"},"_npmUser":{"name":"hamchapman","email":"hamchapman@gmail.com"},"repository":{"url":"git+https://github.com/pusher/pusher-angular.git","type":"git"},"_npmVersion":"3.3.12","description":"Angular library for using Pusher","directories":{},"_nodeVersion":"5.3.0","devDependencies":{"karma":"^0.12.24","istanbul":"^0.3.2","coveralls":"^2.11.2","karma-cli":"0.0.4","uglify-js":"latest","karma-jasmine":"^0.2.2","karma-coverage":"^0.2.6","karma-spec-reporter":"0.0.13","karma-chrome-launcher":"^0.1.5","karma-firefox-launcher":"^0.1.3","karma-phantomjs-launcher":"^0.1.4"},"_npmOperationalInternal":{"tmp":"tmp/pusher-angular-0.1.9.tgz_1455296184437_0.8143722468521446","host":"packages-6-west.internal.npmjs.com"}},"1.0.0":{"name":"pusher-angular","version":"1.0.0","keywords":["pusher","angular","websockets"],"author":{"name":"Hamilton Chapman"},"license":"MIT","_id":"pusher-angular@1.0.0","maintainers":[{"name":"pusherapp","email":"pusherati@pusher.com"},{"name":"hamchapman","email":"hamchapman@gmail.com"}],"homepage":"https://github.com/pusher/pusher-angular","bugs":{"url":"https://github.com/pusher/pusher-angular/issues"},"dist":{"shasum":"04268433273c2a8c1f4122966fc8cddf3ea2fb86","tarball":"https://registry.npmjs.org/pusher-angular/-/pusher-angular-1.0.0.tgz","integrity":"sha512-VF1zJquCATVjvv1Z1X64ERjprwCEmgSIYY3gkXB2Fcr1C08tL7feOIMp4V9vQFks1D7rcf/Ped3Y2p/czQCwjA==","signatures":[{"sig":"MEUCIQD5K84aksnksLjn316mqmrgLg/EIeQ/4KjN5rmMFYuH4AIgbU/1UdXYWod2vnHBYpFuzdtyfm/9QprY3XfDxBHez+g=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"lib/pusher-angular.js","gitHead":"40f5dd51076d851614f69446f28a213d979665d0","scripts":{"test":"karma start karma.conf.js"},"_npmUser":{"name":"pusherapp","email":"pusherati@pusher.com"},"repository":{"url":"git+https://github.com/pusher/pusher-angular.git","type":"git"},"_npmVersion":"5.5.1","description":"Angular library for using Pusher","directories":{},"_nodeVersion":"9.2.0","devDependencies":{"karma":"^1.7.1","coveralls":"^3.0.0","karma-cli":"1.0.1","uglify-js":"^3.2.1","jasmine-core":"^2.8.0","karma-jasmine":"^1.1.1","karma-coverage":"^1.1.1","karma-spec-reporter":"^0.0.31","karma-chrome-launcher":"^2.2.0","karma-firefox-launcher":"^1.0.1","karma-phantomjs-launcher":"^1.0.4"},"_npmOperationalInternal":{"tmp":"tmp/pusher-angular-1.0.0.tgz_1512648661894_0.6883563208393753","host":"s3://npm-registry-packages"}}},"time":{"created":"2015-01-14T17:44:25.437Z","modified":"2026-05-13T07:01:59.569Z","0.1.4":"2015-01-14T17:44:25.437Z","0.1.5":"2015-05-11T13:01:40.389Z","0.1.6":"2015-07-24T13:19:34.214Z","0.1.7":"2015-09-12T16:30:12.043Z","0.1.8":"2015-09-28T15:55:41.454Z","0.1.9":"2016-02-12T16:56:28.863Z","1.0.0":"2017-12-07T12:11:03.508Z"},"bugs":{"url":"https://github.com/pusher/pusher-angular/issues"},"author":{"name":"Hamilton Chapman"},"license":"MIT","homepage":"https://github.com/pusher/pusher-angular","keywords":["pusher","angular","websockets"],"repository":{"url":"git+https://github.com/pusher/pusher-angular.git","type":"git"},"description":"Angular library for using Pusher","maintainers":[{"email":"jeremy.goldstein@bird.com","name":"jeremy.goldstein"},{"email":"pusherati@pusher.com","name":"pushercom"}],"readme":"# Pusher Angular Library\n\n[![Build Status](https://travis-ci.org/pusher/pusher-angular.svg?branch=master)](https://travis-ci.org/pusher/pusher-angular)\n[![Coverage Status](https://img.shields.io/coveralls/pusher/pusher-angular.svg)](https://coveralls.io/r/pusher/pusher-angular?branch=master)\n\nThis library is an open source client that allows you to connect to [Pusher](http://pusher.com/). It keeps largely the same API as the [pusher-js library](http://github.com/pusher/pusher-js/), with a few differences.\n\n## Usage overview\n\nThe following topics are covered:\n\n* Initialisation\n* Subscribing to channels (public, private, and presence)\n* Binding to events\n    * Globally\n    * Per-channel\n    * Bind to everything\n* Presence channel members\n* Connection\n\n\n## Initialisation\n\nThe first step is to make sure that you have all of the required libraries available to your app before you begin. You'll need something like this in your `index.html` (or similar):\n\n````html\n<!-- AngularJS -->\n<script src=\"https://ajax.googleapis.com/ajax/libs/angularjs/1.4.0/angular.min.js\"></script>\n\n<!-- pusher-js -->\n<script src=\"//js.pusher.com/3.0/pusher.min.js\"></script>\n\n<!-- pusher-angular -->\n<script src=\"//cdn.jsdelivr.net/npm/pusher-angular@latest/lib/pusher-angular.min.js\"></script>\n\n<!-- pusher-angular (backup CDN)\n<script src=\"//cdnjs.cloudflare.com/ajax/libs/pusher-angular/1.0.0/pusher-angular.min.js\"></script>\n-->\n````\n\nIf you'd like you can use Bower to install pusher-angular using the following command:\n\n````bash\nbower install pusher-angular --save\n````\n\nWith that in place, to start using the Angular library you first need to create a Pusher client in exactly the same way that you create one using the [pusher-js library](http://github.com/pusher/pusher-js/), which is as follows:\n\n````javascript\nvar pusher = new Pusher(API_KEY);\n````\n\nThere are a number of configuration parameters which can be set for the Pusher client, which can be passed as an object to the Pusher constructor, i.e.:\n\n````javascript\nvar pusher = new Pusher(API_KEY, {\n  authEndpoint: \"http://example.com/pusher/auth\"\n});\n````\n\nThis is all documented in full [here](http://github.com/pusher/pusher-js/).\n\nWhen you've created a Pusher client you then need to pass that client to a `$pusher` object inside your Angular controller, service, etc:\n\n````javascript\nangular.module('myApp').controller('MyController', ['$scope', '$pusher',\n  function($scope, $pusher) {\n    var client = new Pusher(API_KEY);\n    var pusher = $pusher(client);\n}]);\n````\n\nYou can also see here that you need to inject the `$pusher` service into any controllers, services, etc where you'd like to use Pusher in an Angular context.\n\nTo make the `$pusher` service available to be used throughout your app you need to ensure that the `pusher-angular` module is included in your app. You do this by having the following in your app:\n\n````javascript\nangular.module('myApp', ['pusher-angular'])\n````\n\nNote that you can choose to define just one Pusher client, should you prefer, and then use that as the client throughout your Angular app. You can do this by simply instantiating a client as follows:\n\n````javascript\nwindow.client = new Pusher('API_KEY');\n````\n\nand then instantiating instances of `$pusher` in your Angular app using the standard:\n\n````javascript\nvar pusher = $pusher(client);\n````\n\nMake sure that you define client before then referencing it in your Angular app though.\n\nThis is all of the setup required to have Pusher available in your Angular app. The content below will explain how you can utilise Pusher in an Angular app.\n\n\n\n## Subscribing to channels\n\n### Public channels\n\nThe default method for subscribing to a channel involves invoking the `subscribe` method of your `$pusher` object (named `pusher` throughout the examples provided here):\n\n````javascript\nvar my_channel = pusher.subscribe('my-channel');\n````\n\nThis returns a Channel object which events can be bound to.\n\n### Private channels\n\nPrivate channels are created in exactly the same way as normal channels, except that they reside in the 'private-' namespace. This means prefixing the channel name:\n\n````javascript\nvar my_private_channel = pusher.subscribe('private-my-channel');\n````\n\n### Presence channels\n\nPresence channels are again created in exactly the same way as normal channels, except that they reside in the 'presence-' namespace. This means prefixing the channel name:\n\n````javascript\nvar my_presence_channel = pusher.subscribe('presence-my-channel');\n````\n\nIt is possible to access channels by name, through the `channel` function:\n\n````javascript\nchannel = pusher.channel('private-my-channel');\n````\n\nIt is possible to access all subscribed channels through the `allChannels` function:\n\n````javascript\nvar channels = pusher.allChannels();\nconsole.group('Pusher - subscribed to:');\nfor (var i = 0; i < channels.length; i++) {\n    var channel = channels[i];\n    console.log(channel.name);\n}\nconsole.groupEnd();\n````\n\n## Binding to events\n\nEvents can be bound to at 2 levels, the global, and per channel. They take a very similar form to the way events are handled in jQuery. Note that this is one area in which the API differs to pusher-js. In pusher-angular, a call to `bind` will return a decorated version of the callback / handler that you pass as a parameter. You will need to assign this to a variable if you wish to unbind the handler from the object in the future. This is explained in the docs for unbinding below.\n\n### Global events\n\nYou can attach behaviour to these events regardless of the channel the event is broadcast to. The following is an example of an app that binds to new comments from any channel:\n\n````javascript\nvar client = new Pusher(API_KEY);\nvar pusher = $pusher(client);\npusher.subscribe('my-channel');\npusher.bind('new-comment',\n  function(data) {\n    // add comment into page\n  }\n);\n````\n\n### Per-channel events\n\nThese are bound to a specific channel, and mean that you can reuse event names in different parts of your client application. The following might be an example of a stock tracking app where several channels are opened for different companies:\n\n````javascript\nvar client = new Pusher(API_KEY);\nvar pusher = $pusher(client);\nvar my_channel = pusher.subscribe('my-channel');\nmy_channel.bind('new-price',\n  function(data) {\n    // update with new price\n  }\n);\n````\n\n### Binding to everything\n\nIt is possible to bind to all events at either the global or channel level by using the method `bind_all`. This is used for debugging, but may have other utilities.\n\n### Unbind event handlers\n\nRemove previously-bound handlers from an object. Only handlers that match all of the provided arguments (`eventName`, `handler` or `context`) are removed.\n\n````javascript\nvar handler = function() { console.log('testing'); };\nvar decoratedHandler = my_channel.bind('new-comment', handler);\n\nchannel.unbind('new-comment', decoratedHandler); // removes just `decoratedHandler` for the `new-comment` event\nchannel.unbind('new-comment'); // removes all handlers for the `new-comment` event\nchannel.unbind(null, decoratedHandler); // removes `decoratedHandler` for all events\nchannel.unbind(null, null, context); // removes all handlers for `context`\nchannel.unbind(); // removes all handlers on `channel`\n````\n\nThe same API applies to unbinding handlers from the client object.\n\n## Presence channel members\n\nAll presence channels have a members object that contains information about all of the members in the channel. More specific information can be found in the [Pusher docs](http://pusher.com/docs/client_api_guide/client_presence_channels#channel_members).\n\nIn this library the `members` object is setup to automatically reflect changes in members of the channel. That means if you had the following code in a controller:\n\n````javascript\nangular.module('myApp').controller('MyController', ['$scope', '$pusher',\n  function($scope, $pusher) {\n    var client = new Pusher(API_KEY);\n    var pusher = $pusher(client);\n\n    var presence = pusher.subscribe('presence-test');\n    $scope.members = presence.members;\n}]);\n````\n\nand the following HTML in your view:\n\n````html\n<div ng-controller='MyController'>\n  {{members.count}}\n  {{members.members}}\n</div>\n````\n\nyour view would update the members count and the members list whenever there was a member added or removed from the channel.\n\n\n## Connection\n\nYou can bind to specific events on your `$pusher` objects connection, such as `state_change`, using the following code:\n\n````javascript\nvar client = new Pusher(API_KEY);\nvar pusher = $pusher(client);\n\npusher.connection.bind('state_change', function (states) {\n  // var previous = states.previous ...\n})\n````\n\nSimilarly to the client and channel, you can also bind to all events on a connection using the `bind_all` method. That looks like this:\n\n````javascript\nvar client = new Pusher(API_KEY);\nvar pusher = $pusher(client);\n\npusher.connection.bind_all(function (eventName, data) {\n  // if (eventName == 'state_change') { ...\n})\n````\n\n\n## Contributing\n\nIf you'd like to contribute to the library then fork it, hack away at it, improve it, test it, and then make a pull request.\n\nYou can make sure that your changes / improvements don't break anything by running the unit tests. To run them just run `karma start` and then you can go ahead and make changes to the library and the tests and watch the tests run again to see if they're still passing.\n\nYou can generate the minimized file as following:\n\n```bash\nuglifyjs lib/pusher-angular.js -m -o lib/pusher-angular.min.js\n```\n\n## Support\n\nIf you have questions that aren't answered here or in the code's inline documentation then feel free to email [hamilton@pusher.com](mailto:hamilton@pusher.com) or get in touch with [Pusher support](http://pusher.com/about/contact).\n","readmeFilename":"README.md"}