angular-timer

How to get current time from Angular Timer

狂风中的少年 提交于 2019-12-23 20:32:07
问题 I am testing the Angular Timer and have found myself wondering about how to get the current time inside my controller in order to use it to whatever purpose I might have. For instance, I want to set the font color of the timer to red when it reaches a specifict amount of minutes , but I was completely unable to do this. I tried the following: $scope.startTimer = function (deadline) { $scope.$broadcast('timer-start'); $scope.timerRunning = true; if ($scope.minutes == deadline) $scope.turnRed()