How to integrate Angular.js with a realtime messag

2019-03-11 11:52发布

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

5条回答
The star\"
2楼-- · 2019-03-11 12:08

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

查看更多
一纸荒年 Trace。
3楼-- · 2019-03-11 12:09

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/

查看更多
可以哭但决不认输i
4楼-- · 2019-03-11 12:12

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

查看更多
Anthone
5楼-- · 2019-03-11 12:18

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

查看更多
霸刀☆藐视天下
6楼-- · 2019-03-11 12:19

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

查看更多
登录 后发表回答