Yesterday I started looking at the service called Pusher (www.pusher.com) and the need to make it work with Angular. Well it couldn’t have been easier! Here is some code that will work for you.
You will of course need to update API_KEY with your own and change “test_channel” to your own as required.
You may also note that I have adopted the “controller as” syntax in my code and I have done away with $scope, as in Angular 2 that will be gone anyway. I prefer it and it is more in line with how we used to write our JS functions.
Sharing GitHub gists this way is pretty damn sweet too 🙂