Skip to content

Commit 8651fd3

Browse files
committed
Added listener to be able to set countdown value
With the listener one can set the countdown value using $broadcast('countdown-set', value). This might be an edge case, but I need to set a new countdown. This makes the countdown value dynamic set. Issue siddii#23 describes how to set the value on initialization but using this one can change the value whenever necessary.
1 parent c30ff71 commit 8651fd3

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

dist/angular-timer.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,10 @@ angular.module('timer', [])
5252
$scope.clear();
5353
});
5454

55+
$scope.$on('countdown-set', function (e, countdown) {
56+
$scope.countdown = countdown;
57+
});
58+
5559
function resetTimeout() {
5660
if ($scope.timeoutId) {
5761
clearTimeout($scope.timeoutId);

0 commit comments

Comments
 (0)