简体   繁体   English

AngularJS中的计时器

[英]Timer In AngularJS

Why is my timer tag not working in Angularjs? 为什么我的计时器标记在Angularjs中不起作用? I used the following code 我用下面的代码

<timer interval="1000" countdown="100">{{countdown}}</timer> 

Also, how to alert the timer minutes and seconds while I click the get time button given in the plunker? 另外,当我单击插入按钮中的“获取时间”按钮时,如何提醒计时器分钟和秒钟?

Here is the plunker: http://plnkr.co/edit/u4kaFALY0TkUxipjvG0p?p=preview 这是the人: http ://plnkr.co/edit/u4kaFALY0TkUxipjvG0p?p=preview

Include your script after including libraries like jQuery / angular: 包括jQuery / angular这样的库之后,包括脚本:

<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.3.14/angular.min.js"></script>
<script src="https://dl.dropboxusercontent.com/u/8824346/angular-timer.js"></script>
<script src="script.js"></script> <!-- Moved this one after the libraries above. -->

Updated, working plunker. 更新了,可以工作了。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM