@@ -57,7 +57,7 @@ var timerModule = angular.module('timer', [])
57
57
$scope . startTime = null ;
58
58
$scope . endTime = null ;
59
59
$scope . timeoutId = null ;
60
- $scope . countdown = $scope . countdownattr && parseInt ( $scope . countdownattr , 10 ) >= 0 ? parseInt ( $scope . countdownattr , 10 ) : undefined ;
60
+ $scope . countdown = angular . isNumber ( $scope . countdownattr ) && parseInt ( $scope . countdownattr , 10 ) >= 0 ? parseInt ( $scope . countdownattr , 10 ) : undefined ;
61
61
$scope . isRunning = false ;
62
62
63
63
$scope . $on ( 'timer-start' , function ( ) {
@@ -105,8 +105,8 @@ var timerModule = angular.module('timer', [])
105
105
$scope . start = $element [ 0 ] . start = function ( ) {
106
106
$scope . startTime = $scope . startTimeAttr ? moment ( $scope . startTimeAttr ) : moment ( ) ;
107
107
$scope . endTime = $scope . endTimeAttr ? moment ( $scope . endTimeAttr ) : null ;
108
- if ( ! $scope . countdown ) {
109
- $scope . countdown = $scope . countdownattr && parseInt ( $scope . countdownattr , 10 ) > 0 ? parseInt ( $scope . countdownattr , 10 ) : undefined ;
108
+ if ( ! angular . isNumber ( $scope . countdown ) ) {
109
+ $scope . countdown = angular . isNumber ( $scope . countdownattr ) && parseInt ( $scope . countdownattr , 10 ) > 0 ? parseInt ( $scope . countdownattr , 10 ) : undefined ;
110
110
}
111
111
resetTimeout ( ) ;
112
112
tick ( ) ;
@@ -140,7 +140,7 @@ var timerModule = angular.module('timer', [])
140
140
$scope . reset = $element [ 0 ] . reset = function ( ) {
141
141
$scope . startTime = $scope . startTimeAttr ? moment ( $scope . startTimeAttr ) : moment ( ) ;
142
142
$scope . endTime = $scope . endTimeAttr ? moment ( $scope . endTimeAttr ) : null ;
143
- $scope . countdown = $scope . countdownattr && parseInt ( $scope . countdownattr , 10 ) > 0 ? parseInt ( $scope . countdownattr , 10 ) : undefined ;
143
+ $scope . countdown = angular . isNumber ( $scope . countdownattr ) && parseInt ( $scope . countdownattr , 10 ) > 0 ? parseInt ( $scope . countdownattr , 10 ) : undefined ;
144
144
resetTimeout ( ) ;
145
145
tick ( ) ;
146
146
$scope . isRunning = false ;
0 commit comments