Skip to content

Commit 8fe172e

Browse files
committed
Merge branch 'master' of https://github.com/siddii/angular-timer
2 parents ad3c984 + a67196a commit 8fe172e

File tree

4 files changed

+13
-9
lines changed

4 files changed

+13
-9
lines changed

app/js/_timer.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -334,8 +334,10 @@ var timerModule = angular.module('timer', [])
334334

335335
//We are not using $timeout for a reason. Please read here - https://github.com/siddii/angular-timer/pull/5
336336
$scope.timeoutId = setTimeout(function () {
337-
tick();
338-
$scope.$digest();
337+
tick();
338+
// since you choose not to use $timeout, at least preserve angular cycle two way data binding
339+
// by calling $scope.$apply() instead of $scope.$digest()
340+
$scope.$apply();
339341
}, $scope.interval - adjustment);
340342

341343
$scope.$emit('timer-tick', {

dist/angular-timer.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* angular-timer - v1.3.5 - 2017-02-15 4:36 PM
2+
* angular-timer - v1.3.5 - 2017-03-09 11:42 AM
33
* https://github.com/siddii/angular-timer
44
*
55
* Copyright (c) 2017 Adrian Wardell
@@ -341,8 +341,10 @@ var timerModule = angular.module('timer', [])
341341

342342
//We are not using $timeout for a reason. Please read here - https://github.com/siddii/angular-timer/pull/5
343343
$scope.timeoutId = setTimeout(function () {
344-
tick();
345-
$scope.$digest();
344+
tick();
345+
// since you choose not to use $timeout, at least preserve angular cycle two way data binding
346+
// by calling $scope.$apply() instead of $scope.$digest()
347+
$scope.$apply();
346348
}, $scope.interval - adjustment);
347349

348350
$scope.$emit('timer-tick', {

dist/angular-timer.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)