-
Notifications
You must be signed in to change notification settings - Fork 3k
$state.transitionTo('user.modal') does not work with ui.bootstrap dialog #180
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
The $location isn't updated until after the onEnter function is called -- could you be experiencing relative URL problems with the css? BTW, seems like maybe $state should update $location before calling onEnter? |
onEnter should be called identically no matter if the transition is triggered via a manual transitionTo() or $location -- the URL handlers just call transitionTo() anyway. |
Pardon me if this is ignorance, but hasn't the URL already been changed if On Sat, Jun 15, 2013 at 4:27 PM, Karsten Sperling
|
yes, the only difference should be when $location itself changes -- before the transition if it's started from $location, or after otherwise. Does $dialog itself look at $location? |
I'm confused:
So, what you're saying is that no matter whether transitionTo was called by the app or by $urlRouter, in either case the same $location and browser url are in effect when onEnter is invoked? |
No, I was agreeing with you -- the behaviour is identical except for the timing of the $location update. But does $dialog even look at $location itself? |
Dialog takes a templateUrl as a parameter. If that url is relative, then the effective path may be different depending on the location that is in effect when onenter is called? |
I solved the problem using |
@ksperling, are you ok with moving the onEnter call to after the location is updated within transitionTo()? Might make sense to tackle this at the same time as #178. |
Hm well it seems a bit too shotgun to just change things around on the vague hope that it will fix $dialog integration without actually analyzing why the current behaviour is causing a problem. Let's leave this open for now and look at it again in relation to #178 |
I wasn't talking about doing anything right away! Sorry if it sounded like I was about to do a PR or something... I intended only to provoke thought about whether it's worth looking into this, and I worded it badly. |
Doesn't seem to be a recurring issue or feature request. |
Suppose I have two states like so:
If I use an "a" tag with attribute href points to "/user/modal", everything works fine the modal pops as expected. However, I tried to use $state.transitionTo('user.modal'), it would not work correctly.
As further investigation, I diff this two situations and it turns out that by using $state.transitionTo will not add the "triggerClass" and "transitionClass" to the corresponding DOM element. Thus the modal wouldn't show up correctly.
Reference of ui.bootstrap dialog docs - https://github.com/angular-ui/bootstrap/blob/master/src/dialog/README.md
Is there any way I can fix this by hand? I just found this problem as I may dig into the code to see what is wrong with it. Any input is appreciated.
The text was updated successfully, but these errors were encountered: