forked from siddii/angular-timer
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathangularjs-add-countdown-seconds.html
More file actions
28 lines (27 loc) · 1.03 KB
/
angularjs-add-countdown-seconds.html
File metadata and controls
28 lines (27 loc) · 1.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
<!DOCTYPE html>
<html>
<head>
<title>AngularJS Example - Single Timer Example</title>
<!-- compiled CSS -->
<link rel="stylesheet" type="text/css" href="../dist/assets/css/angular-timer-bower.css" />
<!-- compiled JavaScript -->
<script type="text/javascript" src="../dist/assets/js/angular-timer-bower.js"></script>
<script type="text/javascript" src="../dist/assets/js/angular-timer-all.min.js"></script>
<script>
angular.module('MyApp', ['timer'])
.controller('MyAppController', ['$scope', function ($scope) {
$scope.add5Seconds = function () {
$scope.$broadcast('timer-add-cd-seconds', 5);
}
}]);
</script>
</head>
<body ng-app="MyApp">
<div ng-controller="MyAppController">
<h1>AngularJS - Add Countdown Seconds Example</h1>
<h3><timer countdown="10" interval="1000">{{countdown}}</timer></h3>
<button ng-click="add5Seconds()">Add 5 Seconds</button>
</div>
<br/>
</body>
</html>