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

[ui-router] Redirect to child view infinite loop #6

Open
hjylewis opened this issue Aug 3, 2016 · 3 comments
Open

[ui-router] Redirect to child view infinite loop #6

hjylewis opened this issue Aug 3, 2016 · 3 comments
Labels

Comments

@hjylewis
Copy link
Contributor

hjylewis commented Aug 3, 2016

One might want to set up a state to redirect to a sub-state using middleware.
Say, /docs always redirects to /docs/getting-started.

When a simple this.redirectTo('parent.child') middleware is written and called when routing to the parent state, it results in an infinite loop.

Example: (caution: crashes page)
https://plnkr.co/edit/syZdLJQ2I8ZomP7T9ndA?p=preview

In this example, there are state one with sub-states, one.one and one.two and state two. Presently, the only middleware used is one that simply calls this.next().

If one changes the middleware at the two lines commented with // Change to 'redirect' middleware to the redirect middleware, one expects that clicking the one and two links redirect to sub-state one.one. The two link performs as expected, but clicking the one link causes an infinite loop.

@karlhepler
Copy link
Owner

@hjylewis - After merging your pull request and reviewing this issue on the plunkr link you provided, it looks like this is no longer an issue. Would you please confirm whether or not this is still an open issue so that I can adjust the ticket accordingly? Thank you.

@hjylewis
Copy link
Contributor Author

hjylewis commented Aug 9, 2016

@oldtimeguitarguy The issue is still present in the plunkr link for me. Strange.. Did you make sure to change the lines commented with // Change to 'redirect' middleware?

My pull request added functionality unrelated to this issue.

@karlhepler karlhepler added the bug label Aug 10, 2016
@karlhepler
Copy link
Owner

This one is pretty tricky. I worked on it a bit tonight and didn't really get anywhere.

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

No branches or pull requests

2 participants