【文件属性】:
文件名称:angular-sockjs:AngularJS的SockJS组件
文件大小:7KB
文件格式:ZIP
更新时间:2021-05-25 17:13:43
JavaScript
angular-sockjs
AngularJS的提供程序。
基于 。
安装
bower install angular-sockjs
确保已加载。
将此组件提供的socket.js脚本添加到您的应用中。
将bd.sockjs作为模块依赖项添加到您的应用程序。
用法
该模块公开一个socketFactory ,它是一个用于实例化与Angular的摘要循环集成的套接字的API。
制作套接字实例
// in the top-level module of the app
angular . module ( 'myApp' , [
'bd.sockjs' ,
'myApp.MyCtrl'
] )
. factory ( 'mySocket' , function ( socketFactory ) {
return socketFactory ( ) ;
} ) ;
【文件预览】:
angular-sockjs-master
----.jshintrc(63B)
----bower.json(208B)
----src()
--------index.js(1KB)
----.npmignore(99B)
----license(1KB)
----.travis.yml(473B)
----test()
--------.jshintrc(189B)
--------index.js(2KB)
----README.md(3KB)
----.bowerrc(56B)
----.gitignore(24B)
----karma.conf.js(338B)
----package.json(821B)