From 9c7071ca55a71a752d292d51497f629a4b18cb6b Mon Sep 17 00:00:00 2001 From: Yuriy Savenko Date: Thu, 14 Aug 2014 00:17:55 -0400 Subject: [PATCH] Update angular-timer.js Issue found: autoStart attribute does not properly work on the directive. 1) autoStart does not exists: Timer starts automatically (expected behaviour). 2) autoStart exists, set to fasle: Timer starts automatically (expected behaviour). 2) autoStart exists, set to true: Timer does not start automatically (NOT expected behaviour). This happens because variable $scope.autoStart (on line 256 in the "if" statement) is a 'string' type. So "$scope.autoStart === true" never passes. Proposal solution will fix the problem with variable type. --- dist/angular-timer.js | 1 + 1 file changed, 1 insertion(+) diff --git a/dist/angular-timer.js b/dist/angular-timer.js index ebc5693..c7ca33b 100644 --- a/dist/angular-timer.js +++ b/dist/angular-timer.js @@ -253,6 +253,7 @@ var timerModule = angular.module('timer', []) } }; + $scope.autoStart = $scope.$eval($scope.autoStart); if ($scope.autoStart === undefined || $scope.autoStart === true) { $scope.start(); }