Skip to content

Relative path in $state.go should be based on the path of the controller which defined $state instead of the current path #710

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
bachue opened this issue Dec 22, 2013 · 2 comments

Comments

@bachue
Copy link

bachue commented Dec 22, 2013

For example, in http://jsfiddle.net/Bachue/cQmT7/

When we click a or b for the first time, the state will change correctly, but if we click any of them again, exception will be raised.

Although I know ui-sref tag can resolve this problem, but sometimes we may have to do more things(e.g. ajax) so we still need to use method.

Thanks.

@dlukez
Copy link
Contributor

dlukez commented Dec 23, 2013

As $state is a shared service, one might think that it's behaviour should be consistent across controllers. This function could be called from other non-state controllers, like a directive, or straight use of ngController.

When #636 goes in you could keep a copy of the $state that was active when the controller was instantiated and pass it in to $state.go()

@timkindberg
Copy link
Contributor

Yeah unfortunately I'm not sure this is a feasible request, per @dlukez reasons.

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