search

Home  >  Q&A  >  body text

angular.js - angular {{time | date:'mm:ss'}} to implement countdown.

<span>{{time | date:'mm:ss'}}</span>

$scope.time= 900000; //15分钟

$one_minute = $interval(function(){
    $scope.time--;
},1000);

In this case, it will only move once at 14:59 and then stop moving date:'mm:ss' There is a problem here

習慣沉默習慣沉默2870 days ago599

reply all(1)I'll reply

  • 巴扎黑

    巴扎黑2017-05-15 17:05:11

    Just click $scope.time--;换成$scope.time -= 1000; and it’s OK, the time format is fine.

    reply
    0
  • Cancelreply