Skip to content

RFC: Remove click binding from uiSref directive #689

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
roryf opened this issue Dec 17, 2013 · 3 comments · Fixed by #690
Closed

RFC: Remove click binding from uiSref directive #689

roryf opened this issue Dec 17, 2013 · 3 comments · Fixed by #690

Comments

@roryf
Copy link

roryf commented Dec 17, 2013

Since the uiSref directive sets the href attribute, I can't see the reasoning behind also binding to the click event and changing state. The event handler seems to further do a bunch of checks to prevent ctrl-click etc. and ensure any ng-click directives are run first.

My use-case for this is I have various links with target="_self" to prevent client-side routing. Previously these had href attributes, but I'm now moving to ui-sref and the target attribute is ignored.

Is there a good reason for binding to click event rather than letting the browser/angular manage the state transition?

@nateabele
Copy link
Contributor

Not all states have URLs, and some states don't map 1:1 with the URLs that represent them.

@roryf
Copy link
Author

roryf commented Dec 17, 2013

Thanks, got it now.

Would it be a valid feature to check the target attribute then?

@nateabele
Copy link
Contributor

Definitely.

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

Successfully merging a pull request may close this issue.

2 participants