简体   繁体   中英

Handling updates from a server route/controller in Angular

Hi guys i have some experience with using Angular

Basically i need to know whether i can push updates to Angular controller from the backend and how theoretically it can be done?

In the traditional REST sense i'm pulling 100 records via a get request from angular controller but how about if i wanted to call get once, then as the data is updated every second or two on the server it pushes to Angular

我认为您最好的机会是实施轮询机制来检查更新或查看SignalR

You're looking for websockets. Depending on your server you will need a specific module or configuration.

For nodeJS we use socket.io

For tomcat you can take a look at https://tomcat.apache.org/tomcat-7.0-doc/web-socket-howto.html

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM