Skip to content

two way binding on countdown attr #155

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
two way binding on countdown attr
allows dynamic update of countdown. removed the parseInt countdownattr because it no longer seems necessary
  • Loading branch information
simon-lang committed Feb 18, 2015
commit 65106d7153316c1dd92e41f6e8e5fd08d6dd71f3
4 changes: 2 additions & 2 deletions app/js/timer.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ var timerModule = angular.module('timer', [])
countdownattr: '=countdown',
finishCallback: '&finishCallback',
autoStart: '&autoStart',
maxTimeUnit: '='
maxTimeUnit: '=',
countdown: '='
},
controller: ['$scope', '$element', '$attrs', '$timeout', '$interpolate', function ($scope, $element, $attrs, $timeout, $interpolate) {

Expand All @@ -36,7 +37,6 @@ var timerModule = angular.module('timer', [])
$scope.startTime = null;
$scope.endTime = null;
$scope.timeoutId = null;
$scope.countdown = $scope.countdownattr && parseInt($scope.countdownattr, 10) >= 0 ? parseInt($scope.countdownattr, 10) : undefined;
$scope.isRunning = false;

$scope.$on('timer-start', function () {
Expand Down