<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>
上面代码:倒计时 ng-repeat可获取到毫秒差值 list.openTime 需要做成倒计时的字符串显示在 span中,请问应该怎么做?
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.