siddii / angular-timer

re-usable/inter-operable AngularJS timer directive ⛺
http://siddii.github.io/angular-timer/
MIT License
792 stars 938 forks source link

Can end time be defined without countdown? #83

Open davorpeic opened 10 years ago

davorpeic commented 10 years ago

I need to 'reverse' countdown in terms that I need my timer starts with 0 and ends on some particular moment, lets say 30s.

As a workaround I use 'timer-tick' event and check if the running time is the time when it needs to end, and if yes, then I stop the timer, but not sure if there is a built-in way to this?

something as

thank you

BobKurtis commented 9 years ago

I was able to acheive this without using timer-tick. I set it up like <timer interval="1000" start-time="startTime" end-time="endTime">{{minutes}} min{{minutesS}}. {{seconds}} sec{{secondsS}}.</timer> Where startTime and endTime reference variables that are in $scope.