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

registering tracker might requre a revision #40

Closed
vetik32 opened this issue Feb 6, 2014 · 4 comments
Closed

registering tracker might requre a revision #40

vetik32 opened this issue Feb 6, 2014 · 4 comments

Comments

@vetik32
Copy link

vetik32 commented Feb 6, 2014

scenario a face the issue.
http://plnkr.co/edit/XU0tvWsfKcuJPL9oXyCh

has a simple ui router, (I guess same story with ngroute)

with original promise-tracker I get:
Error: Tracker with id "loadingTracker" already exists!

Long story short, when switching from view/controller to another then return back, we face errors because of -reregistering same promises/trackerId.

what's the way it should be done? use the plnkr link to see what I mean.

also I'll create a pull request to show the mods that addresses the issue for me.

p.s. I didn't run the tests from the project.

@ajoslin
Copy link
Owner

ajoslin commented Feb 7, 2014

Hi @vetik32 - now you use promiseTracker.register(id) to create a tracker, then promiseTracker(id) to get it.

@ajoslin
Copy link
Owner

ajoslin commented Feb 7, 2014

Plunkr fixed - http://plnkr.co/edit/ciQLISuC40Ay2gVFDnGG?p=preview

The whole ID system will probably be removed before 2.0, though.

@vetik32
Copy link
Author

vetik32 commented Feb 9, 2014

thanks for a quick reply. I don't quite fill ok with registering all possible trackers on bootstrapping.
I'm using it with angular-busy directive. will think it over, thanks.

@ajoslin
Copy link
Owner

ajoslin commented Feb 9, 2014

Well you don't have to do it on bootstrap, just somewhere it will only happen once.

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

2 participants