Skip to content

Strange behavior on resolve and $scope #1353

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

Closed
baudetail opened this issue Sep 10, 2014 · 2 comments · Fixed by #1360
Closed

Strange behavior on resolve and $scope #1353

baudetail opened this issue Sep 10, 2014 · 2 comments · Fixed by #1360
Labels
Milestone

Comments

@baudetail
Copy link

I have nested states.
The parent state has a resolve for 'item'.
The child state also has resolve for a variable 'item'.

When I navigate to the child state through the URL all works fine.
When I navigate to the child state through $state.go or ui-sref the $scope is messed up.
If I press F5 on the child state all works fine.

Conclusion:
Nested states with same resolves in parent and child results in inconsistent $scope

Examples - Please see console for debug output.

Example in Version 0.2.11:
http://plnkr.co/edit/BThnqNrZa4b9SRcZG8qv?p=preview

same Example in Version 0.2.10:
http://plnkr.co/edit/Hm22nLoOsf3zBJKx79TB?p=preview

another Example in Version 0.2.11 with abstract parent:
http://plnkr.co/edit/CjzSIGqOCZKaMGr9IBXI?p=preview

In Version 0.2.10 all works fine
In Version 0.2.11 it is an BUG

@christopherthielen
Copy link
Contributor

Thanks for the plunkrs.

christopherthielen added a commit that referenced this issue Sep 12, 2014
…me name

Made resolve values ignore any keys that we're actively trying to
resolve, when they also exist in some parent state.  Made $$resolves
persist so they can be picked up by a child state in a later digest()
fixes #1317
fixes #1353
@christopherthielen
Copy link
Contributor

This was a pain in the butt to track down. 👎 to $resolve

plunk with PR #1360 integrated:
http://plnkr.co/edit/7FTf8g1NhubTLYKQZnfd?p=preview
http://plnkr.co/edit/Yrq8XuRDTWZiDFy9CqrD?p=preview

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment