Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/siddii/angular-timer
Browse files Browse the repository at this point in the history
  • Loading branch information
simonemazzoni committed Mar 9, 2017
2 parents ad3c984 + a67196a commit 8fe172e
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 9 deletions.
6 changes: 4 additions & 2 deletions app/js/_timer.js
Original file line number Diff line number Diff line change
Expand Up @@ -334,8 +334,10 @@ var timerModule = angular.module('timer', [])

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

$scope.$emit('timer-tick', {
Expand Down
8 changes: 5 additions & 3 deletions dist/angular-timer.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* angular-timer - v1.3.5 - 2017-02-15 4:36 PM
* angular-timer - v1.3.5 - 2017-03-09 11:42 AM
* https://github.com/siddii/angular-timer
*
* Copyright (c) 2017 Adrian Wardell
Expand Down Expand Up @@ -341,8 +341,10 @@ var timerModule = angular.module('timer', [])

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

$scope.$emit('timer-tick', {
Expand Down
4 changes: 2 additions & 2 deletions dist/angular-timer.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 8fe172e

Please sign in to comment.