I'm working on a MEAN project as my hobby. I use Node.js as the back end and Angular.js as the front end. Node.js will execute a long lasting task (it takes about 30 minutes to execute this task), I want to display the task status on the view page. How can I achieve this?
相关问题
- npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fs
- angularJS: ui-router equivalent to $location.searc
- Separate AngularJS Controllers Into Separate Files
- google-drive can't get push notifications
- How to reimport module with ES6 import
相关文章
- node连接远程oracle报错
- How can make folder with Firebase Cloud Functions
- Passing variable through URL with angular js
- @angular-cli install fails with deprecated request
- Watch entire object (deep watch) with AngularJS
- Angular ng-if change span text
- node.js modify file data stream?
- Can ng-show directive be used with a delay
I think what you are talking about is a streamed request. Take a look at this http://strongloop.com/strongblog/streaming-chunked-html-node-js-data/.
And in the front-end there is a Javascript API method called EventSource that can read a streamed response or as someone else mentioned you can use sockets if you need bi-directional communication.
Maybe
socket.io
is a good choice.Socket.IO enables real-time bidirectional event-based communication. And with this, Server can take the initiative to send message to Client.
Visit http://socket.io/ for more info.