javascript - Angular Performance Degrading after Refreshing Data -


i've started getting grips angularjs, i've found application runs performance issues after few minutes.

edit: seems happens in ie11

i have page imports json array every 1 minute follows:

$http.get('http://localhost/statuscheck.php?rnd' + new date().gettime()).         success(function (data) {              $scope.statuschecks = data;             $scope.onlinecount = parseint(0);             $scope.offlinecount = parseint(0);             $scope.totalchecks = parseint(0);             $scope.disabledcount = parseint(0);             $scope.checkcomplete = false;               angular.foreach($scope.statuschecks, function (obj) {                   $http.get('http://localhost/monitoring_test.php?websiteid=' + obj.websiteid + '&rnd' + new date().gettime()).                         success(function (data) {                              if (data.status == 'online') {                                 $scope.onlinecount = parseint($scope.onlinecount) + 1;                             } else if (data.status == 'offline') {                                 $scope.offlinecount = parseint($scope.offlinecount) + 1;                                 sitesdownarr.push(obj.websiteid);                             }                              $scope.totalchecks = parseint($scope.totalchecks) + 1;                              if ($scope.totalchecks == $scope.statuschecks.length) {                                 $scope.checkcomplete = true;                             }                          });               });          });   

then use $scope.tasks object on page show information. data changes regularly, used $timeout re-run http.get import data again.

i intending have browser window open day, watching page change data changes. however, after few minute browser window grind halt due long running script. seems things bog down after few refreshes of data.

am going wrong way?


Comments

Popular posts from this blog

authentication - Mongodb revoke acccess to connect test database -

r - Update two sets of radiobuttons reactively - shiny -

ios - Realm over CoreData should I use NSFetchedResultController or a Dictionary? -