<p ng-switch="list.state">
<p ng-switch-when="0">
<p class="rob text-center btn-rob" ng-if="list.openTime<=0">
<p class="content">开抢<br></p>
</p>
<p class="rob text-center btn-full" ng-disabled="true" ng-if="list.openTime>0">
<p class="content">即将开标<br><span >这里需要倒计时</span></p>
</p>
</p>
<p ng-switch-when="1" class="rob text-center btn-full" ng-click="jump('/invest')" ng-disabled="true">
<p class="content">满标</p>
</p>
</p>
The above code: Countdown ng-repeat can get the millisecond difference list.openTime. The string that needs to be made into a countdown is displayed in the span. What should I do?
list.openTime
This variable itself should already exist in the controller. Normally you should have this sentence in your controllerIf this list.openTime is just a value sent back by the server and does not need to be sent back to the server, then you can directly operate the period in the controller.
If
list.openTime
is still useful, then clone it to another variable and use another variable to decrement.Strictly speaking, the decrement function should be put into a variable and canceled when the decrement ends.
That’s probably what it looks like.