Skip to content
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

Multiple Timers Stop Events #73

Closed
patnevin opened this issue May 16, 2014 · 5 comments
Closed

Multiple Timers Stop Events #73

patnevin opened this issue May 16, 2014 · 5 comments

Comments

@patnevin
Copy link

Loving the timer so far - really simple to use. I'm having one small issue however.

I have multiple timers all being kicked off with different countdown values (essentially a list of ebay style auction items counting down) inside an ng-repeat.

I see there is a 'timer-stopped' event which is ideal as I'd like to refresh the item on this event, however I can't seem to find a way for the event to tell me which timer has expired.

Is there a way of doing this? Neither the "data" or "event" arguments seem to have a timerId or equivalent, and I can't see this being used in any of your examples.

Thanks in advance.

@siddii
Copy link
Owner

siddii commented May 17, 2014

@siddii siddii closed this as completed May 17, 2014
@siddii
Copy link
Owner

siddii commented May 17, 2014

FYI - Here is the example code showing the arg sent on timer-stopped event - http://siddii.github.io/angular-timer/examples/angularjs-multiple-timers.html

@patnevin
Copy link
Author

Hi siddii, thanks for looking at this so quickly!

I can now see the "timeoutId" on the stop event now, however maybe I'm misunderstanding what this is, as the id seems to change when you start/stop the timers in your example. I also can't see how this timeoutId relates to the timer?

In my example, I have an ng-repeat with 10 items all having seperate timers, with separate finishing dates. Ideally I'm looking for something like a $index to let me know which timer has expired so I can then display an "Auction Ended" message on the item instead of "0 seconds" etc.

Or maybe is there a way of passsing an Id into the < timer > element or anything like that?

Thanks again.

@siddii
Copy link
Owner

siddii commented May 20, 2014

No, you are looking for something similar to this - http://plnkr.co/edit/GjKSSVM1x2UQC2gLQeGo?p=preview

@mkarrfan
Copy link

mkarrfan commented Jul 3, 2018

The plnkr is not working!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants