Sunday 15 March 2015

javascript - Binding JSON data in Angular -


I am evaluating the JS framework to use for a project and I get stuck between angular and amber I am Before ending your assessment of Kangaroo, I need to know that there is an easy way to bind data from an external JSO file stored on S3.

Creating a scoreboard using my case data is occasionally published live on S3 ... usually 15 seconds or so on.

Right now, I am just making a basic scoreboard page with data from a local json file, but when it is updated in the index.html, the JSN file changes or does I Interrupted making callback?

Any help is appreciated. Thanks!

  // app.js var app = angular Module ('app', []); App.controller ('scoreboardcoot', function ($ amount, $ http) {$ http.get ('scoreboard.jason'). Then (function (race) {// json data object as 'scoring' $ radius Storing scores = res.data;});});   

The scoreboard is created by cycling through scores:

     

What is the way to update the data in the index when the Json file Change

It should already be done. If you change $ scope.scores , the view is updating.

If you have to update it from a live server, simply call setInterval (or $ timeout service) and call $ http.get at regular intervals. .

No comments:

Post a Comment