-
Notifications
You must be signed in to change notification settings - Fork 3k
$state.transitionToUrl - to return the path/url of a transition #55
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
Comments
Essentially that is what issue #16 is about, even though the plan was to expose it as a directive. There is no reason why we can't have both a function and a directive (which uses the function). Are there any particular use cases where a function would be preferable over a directive? |
#16 is cool, I hadn't seen that. A couple of cases where a function would be preferred:
In any case, exposing more of the currently hidden helper functions (like this transitionUrl function or "findState") would make ui.state easier to use. |
Closing this, @nateabele 's $state.href() has been merged |
@ksperling and @dbrans - Here's a use case. I'd like to reroute someone from within a resolve function inside an abstract state. I can get a $stateParam from injecting it into the resolve. But, the $state.current is an empty string (I'm assuming because it's abstract). I could use the url to redirect thought ($location.path.replace()). Thoughts? |
I don't really understand why you'd do a redirect within a resolve instead of, for example |
I wouldn't mind using |
I agree I should wish @ksperling good luck with his work on |
Sometimes I would prefer to use
<a href>
with the appropriate path/url instead of calling$state.transitionTo(state)
.For this purpose, it would be nice to have an equivalent
$state.transitionToUrl
and some helpers to get the transition urls forHere is an example of the api:
Would others find this useful?
The text was updated successfully, but these errors were encountered: