Rails API + AngularJS + Websocket-Rails gem [英] Rails API + AngularJS + Websocket-Rails gem
问题描述
我的服务器正在运行websocket-rails gem来处理websockets.
My server is running the websocket-rails gem to handle websockets.
在将websocket-rails与使用angular的phonegap项目结合使用时遇到问题,因为我需要在Angular前端中独立于rails资产管道来初始化websocket-rails客户端.
I'm having trouble using websocket-rails with a phonegap project that uses angular because I need to initialize the websocket-rails client in my Angular front end independent of the rails asset pipeline.
是否可以将websocket-rails客户端分别加载到有角度的项目中?还是可以使用angular socket指令来管理websocket-rails的套接字?
Is it possible to load the websocket-rails client separately into an angular project? Or can I use an angular socket directive to manange sockets with websocket-rails?
推荐答案
我设法使它正常工作.
我使用coffescript CLI工具将所有咖啡脚本翻译成js.然后,我将这些文件添加到我的项目中,然后根据websocket-rails文档在控制器中调用方法.
I translated all the coffeescripts into js with the coffescript CLI tool. Then I added those files to my project then called the methods in the controller per the websocket-rails docs.
这篇关于Rails API + AngularJS + Websocket-Rails gem的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!