-
Notifications
You must be signed in to change notification settings - Fork 3k
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
$stateNotFound event not called #1356
Comments
It's not yet supported. ui-sref assumes all states are loaded at config time. Sorry that the defaultPrevented is causing you issuesl. I'm open to ideas. |
ui-sref is work |
Sorry for the issue close - writing comment on the phone is not ideal :). ui-sref directive is working fine. When i clicked on link without existing state, $stateNotFound was called and then new module with routes was loaded - in v0.2.9. Could ui-sref set some non-empty value to href attribute of the link to prevent Angular's anchor directive to prevent the transition? I don't know UI router internals and if this could cause some issues. |
I just wrote PR #1363 for a different but related issue. This PR doesn't quite fix your problem, though, because you don't have a state at all, as opposed to having a state with an empty URL. I ran into this same issue with "future states" and ended up not using ui-sref at all. Maybe we could add something to ui-sref-opts that forces a link to be navigable. I'm still working on that PR. Let me take a closer look. |
@neonncz can you try with the latest ui-router? https://gist.github.com/christopherthielen/99f1ffb873493c83bb26 |
Great, this release works. |
@neonncz great. Although that's not a 'release' really, I just built the current |
Hi,
I have a problem when using UI Router 0.2.11 and Angular 1.3-rc.0. My app is lazy loading modules (and their routes). But new implementation of
uiSref
directive provides custome.preventDefault()
, which is called by Angular'shtmlAnchorDirective
and cancels state transition - so it does not trigger$stateNotFound
where I loaded new module.The problem is that link pointing to a state that has not been resolved yet has no
href
attribute.https://github.com/angular/angular.js/blob/2e641ac49f121a6e2cc70bd3879930b44a8a7710/src/ng/directive/a.js#L35
I believe this commit changed this behavior:
2e6d916
Is it a bug or should i use another approach?
Thanks
The text was updated successfully, but these errors were encountered: