1

I want to receive streaming data from flask application in angularjs. Previously, I was making hundreds of $http calls from browser, and was appending their responses to a single variable in angularjs which was updating the HTML automatically every time it received a response from one of those AJAX calls. Now I want to move all that logic to backend, thus want to have a single HTTP call which will receive streaming data from flask application, and it is expected that HTML will be updated every time a streaming response is received at front end. How can I achieve that?

BTW, I leaned how to stream data from flask application to front end. But I want to know how should I receive it in angularjs.

user2987346
  • 191
  • 2
  • 11

2 Answers2

0

May be I'm not understanding your problem correctly, but from the gist of it I think you need to look into web-sockets to get streaming up and running. Implementing sockets in AngularJS

Kenneth Lynne
  • 15,461
  • 12
  • 63
  • 79
  • Hi Kenneth, actually I am not using socket at backend. All I am doing is streaming some data to front end [(Streaming in Flask)](http://flask.pocoo.org/docs/patterns/streaming/). But I am not aware of "how to read streaming data in angularjs (or in JQuery or even in Javascript)". – user2987346 Nov 18 '13 at 12:48
0

Here's an answer showing how to stream data from flask to the frontend and processing the stream-events in javascript.

https://stackoverflow.com/a/13388915/649698

This helped me a lot.

Community
  • 1
  • 1
CrizZ
  • 41
  • 3