angular-timer
angular-timer copied to clipboard
no attribute $watch() ?
If I set a variable myTimer when we click on a button with the following HTML but it's seems that it's not working :
<div ng-init="myTimer = 9999999999999">
Current `myTimer` : {{myTimer}}
<br/>
<button ng-click="myTimer = 88888888888888">Change the value to `88888888888888`</button>
<button ng-click="myTimer = 9999999999999">Change the value to `9999999999999`</button>
<br/>
<timer end-time="myTimer">{{days}} days, {{hours}} hours, {{minutes}} minutes, {{seconds}} seconds.</timer>
</div>
It seems that the plugin does not $watch() the attibutes.
I added this monkey patch code in the plugin to test and it seems to work (line 39) :
$scope.$watch('endTimeAttr', function(newVal){
if(newVal){
$scope.start();
}
});
Did I miss something or we could imagine to add some $watch() in the plugin?
reproduced at my side as well.