-
Notifications
You must be signed in to change notification settings - Fork 3k
Allow state options to be overidden in ui-sref directive #694
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
Allow state options to be overidden in ui-sref directive #694
Conversation
hmm, I can see that it's flexible, but hmmm... I'm not sure how I feel about this |
Since params are parsed with a regex, we cannot add options in the same place ... I can see only two options :
Anyways, I think that using regex for this kind of stuff is the wrong way to go. |
This has actually already been brought up and rejected in a different pull request, but this is a different approach. This approach matches what @nateabele had mentioned was his idea for implementation in his last comment. See #644. I think I'm ok with this enhancement. @nateabele? |
@@ -35,6 +35,9 @@ function stateContext(el) { | |||
* to the state that the link lives in, in other words the state that loaded the | |||
* template containing the link. | |||
* | |||
* Options passed to the `$state.go()` also can be overiden with the `ui-sref-opts` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo: overiden => overridden
Finally following up on this... I can definitely see some jankyness happening if people are able to arbitrarily overwrite any |
That's the gist of it... If there are specific options supported, it seems less harmful. One thing I don't necessarily want is another $watch, this should probably be evaluated only at link-time. Anyways, it's just my opinion :> |
Well, at worst I guess we could |
Any update on this being merged? If there's changes to be made, I can jump in. |
@roryf Yeah, could you? Here's what's outstanding:
Please feel free to fire off any questions you might have. |
Implemented in #813. |
This makes me feel like we should have done ui-sref-params as a separate directive too, instead of coming up with our own string syntax there. |
Options passed to the
$state.go()
and$state.href()
cannot be changed while using the ui-sref directive.