This is my controller function
setInterval(function () {
var d = new Date();
var seconds = d.getMinutes() * 60 + d.getSeconds();
var fiveMin = 60 * 1;
var timeleft = fiveMin - seconds % fiveMin;
var result = parseInt(timeleft / 60) + ':' + timeleft % 60;
//console.log(result);
var timerObj= {
timer : result
}
$scope.timerArray = timerObj;
if (timeleft === 1) {
$scope.statusDetails = $scope.reset;
$scope.timeDetails();
$scope.get_dbStatus();
$scope.get_sosStatus();
$scope.get_cepStatus();
$scope.get_taskStatus();
$scope.get_mqStatus();
$scope.get_mrStatus();
$scope.get_dmStatus();
}
$scope.$apply();
},500);
This is my html page
<table class="table">
<thead>
<tr>
<th class="col-lg-5 col-sm-5">
Name
</th>
<th class="col-lg-2 col-sm-2">
Version
</th>
<th class="col-lg-1 col-sm-3">
Status
</th>
<th class="col-lg-2 col-sm-2">
Contact Info
</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="status in statusDetails">
<td>{{status.title}}</td>
<td>{{status.apiVersion}}</td>
<td><img ng-src="../public/tcup/images/{{status.status}}.png"/></td>
<td>-</td>
</tr>
</tbody>
</table>
Timer and all the things are working fine.But each time timer gets expired and the list gets refreshed the updated list appends to the previous list.