3
Well I have a grid and it needs to be ALWAYS updated because it contains information that needs to be updated dynamically.
This grid is populated with a Rest flame that returns me a json. I need the grid updated as soon as the json of the Rest call has some change.
In my case to handle the data of json and place on the grid I am using Angularjs and populating with an ng-repeat. Today I’m taking the updates with a 1 second setInterval... but this is not cool, because if I have to put some checkbox on this grid, I will not be able to check because as updates 1 in 1 second would always return to the state of FALSE.
Would you have any solution? I don’t know how the websites that "broadcast" football games work... but it’s kind of like this. I wanted to know how they do to add or remove grid lines without having to refresh the grid or the whole scope.
My JS:
var app = angular.module("teste", []);
app.controller("GridController", ['$scope', '$http', function (ng,
$http) {
ng.locations = [];
setInterval(function() {
$http.get("http://testechamarest.com:18888/json").success(function
(dados) {
ng.locations = $.map(dados, function (dev) {
return dev;
});
}, 1000); ]);
New problem: When I change the time of updates, for example: put 3000(3 sec) the page takes 3 seconds to open... in the current house is taking 1 sec to open... my logic when doing this must be all wrong... but I do not know what I could improve. :(
Take a peek at the Meteor - I think you’ll like it.
– J. Bruni
Poxa company does not open https... but I think I would have to change all my structure... would not be cool this time of the project.
– peterq