forked from siddii/angular-timer
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocs.js
More file actions
30 lines (27 loc) · 958 Bytes
/
docs.js
File metadata and controls
30 lines (27 loc) · 958 Bytes
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
29
30
angular.module('timer-demo',['timer']).controller('TimerDemoController',['$scope', function ($scope) {
$scope.linkAnchors = function () {
$('ul.nav a').click(function (){
var path = $(this).attr('href');
if (path != '#') {
window.location = path;
}
});
};
$scope.btnText = {
reset: "Start",
started: "Stop",
stopped: "Resume"
};
$scope.currentYear = (new Date).getFullYear();
$scope.startTime = (new Date($scope.currentYear, 0, 1)).getTime();
$scope.endYear = $scope.currentYear+1;
$scope.endTime = (new Date($scope.endYear, 0, 1)).getTime();
$scope.callbackTimer={};
$scope.callbackTimer.status='Running';
$scope.callbackTimer.callbackCount=0;
$scope.callbackTimer.finished=function(){
$scope.callbackTimer.status='COMPLETE!!';
$scope.callbackTimer.callbackCount++;
$scope.$apply();
};
}]);