如果此倒数计时器alert()
过去{{sale.vtimer | date:'mm:ss'}}
,我正试图00:00
:
$scope.updateVtimerValue = function (vtimerValue){
$.each(vtimerValue, function(k, v) {
for (var i =0; i < $scope.sales.length ; i ++) {
if($scope.sales[i].orderid == v.orderid){
var nDate = Date.now();
var nTime = Date.parse(v.xtime);
$scope.sales[i].vtimer = nTime - nDate;
}
}
});
}
<tr ng-repeat="sale in sales" ng-cloak>
<td>{{sale.vtimer | date:'mm:ss'}}</td>
</tr>
答案 0 :(得分:1)
如果现在和前一帧之间的差异小于或等于零,则表示您已达到00秒
if($scope.sales[i].vtimer <= 0){
alert("Timer is over");
}