如何在angularjs中执行signalr任务(特别是在hub.start.done()中) [英] How do I perform signalr tasks in angularjs (specifically in hub.start.done())

查看:205
本文介绍了如何在angularjs中执行signalr任务(特别是在hub.start.done()中)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





我正在将代码移到AngularJs中。我使用SignalR锁定我的剑道表中的记录。通常服务器会将通知推送到客户端,但在启动时我需要它来检查是否存在任何锁。我以前在 $ connection.start()。done(function(){}); 中这样做但是现在我使用AngularJs我觉得我不能仍然使用它(可以吗?也许我从一开始就错了。)



我看过一些使用工厂的例子,但是作为一个使用AngularJs的n00b我不知道看看如何执行这些连接开始功能。



有人可以帮我提供示例或简单的教程链接,请^ _ ^





如果您想查看我的旧js或新的角度代码,请询问您是否认为它是相关的。



谢谢^ _ ^

Andy



PS:我正在使用网络表单,所以没有MVC,请。我还没有掌握它,但我猜Angular是相似的?

Hi,

I am moving my code into AngularJs. i use SignalR to "lock" records in my kendo table. usually the server pushes notification to the clients but on startup I need it to check for any existing locks. I used to do this within the $connection.start().done(function(){}); but now that I am using AngularJs I don't think I can still use that (can I? maybe I'm wrong from the start).

I have seen some examples of using factories, but being a n00b with AngularJs I don't see how to perform these "on connection start" function.

Could someone help me with examples or an easy tutorial link, please ^_^


If you would like to see my old js or new angular code, just ask if you think it's relevant.

Thanks ^_^
Andy

PS: I am using web forms so no MVC, please. I haven't got to grips with that yet either, but I guess Angular is similar?

推荐答案

connection.start()。done(function(){}) ; 但是现在我正在使用AngularJs我不认为我仍然可以使用它(我可以吗?也许我从一开始就错了)。



我见过一些使用工厂的例子,但是使用AngularJs是一个n00b我没看到如何执行这些on connection start功能。



可以有人帮我提供示例或简单的教程链接,请^ _ ^





如果你想看到我的旧js或新的角度代码,只要问你认为它是否相关。



谢谢^ _ ^

Andy



PS:我正在使用网络表单,所以没有MVC。我还没有掌握这个,但我猜Angular是相似的吗?
connection.start().done(function(){}); but now that I am using AngularJs I don't think I can still use that (can I? maybe I'm wrong from the start).

I have seen some examples of using factories, but being a n00b with AngularJs I don't see how to perform these "on connection start" function.

Could someone help me with examples or an easy tutorial link, please ^_^


If you would like to see my old js or new angular code, just ask if you think it's relevant.

Thanks ^_^
Andy

PS: I am using web forms so no MVC, please. I haven't got to grips with that yet either, but I guess Angular is similar?


这篇关于如何在angularjs中执行signalr任务(特别是在hub.start.done()中)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆