How to integrate Angular.js with a realtime messaging service like Pusher or PubNub?

懵懂的女人 提交于 2019-12-20 10:54:17

问题


Is it possible to define Pusher or PubNub as an Angular Service? Does someone have code examples of such an integration?


回答1:


Someone already made it :-): http://jsfiddle.net/bv5Kq/13/

Be sure to check out the wiki for examples: https://github.com/angular/angular.js/wiki/JsFiddle-Examples




回答2:


There is AngularFire, for working with Firebase - http://angularfire.com/




回答3:


Try this one. It has color changing, emoticons, clickable hyperlinks and multiple channels. No database or sockets required, just a PubNub account: http://jadendreamer.wordpress.com/2013/10/22/advanced-angular-chatroom-tutorial-no-database-or-sockets-required/




回答4:


There is a somewhat "unofficial" AngularJS library for PubNub. It is a simple service wrapper for the global PUBNUB library object. The main code is in app/scripts/pubnub-angular.coffee and looks like this:

angular.module('pubnub.angular.service', [])
  .factory 'PubNub', () -> PUBNUB

You can find the GitHub repository here:

https://github.com/pubnub/angular-js




回答5:


Try this: https://disparity.github.io/angular-pusher/, module for integration pusher events into angular event system



来源:https://stackoverflow.com/questions/12528403/how-to-integrate-angular-js-with-a-realtime-messaging-service-like-pusher-or-pub

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!