-
Notifications
You must be signed in to change notification settings - Fork 3k
State: onEnter callback executed before template added to DOM #575
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
I don't understand. Is there a question in here? |
No, I am saying that onEnter should be fired after the template is added to the DOM. To me, the state has not fully entered until the template is in the DOM. If you don't agree that's fine. |
I could see it from that pov. |
Well, even if I agreed (which I mostly don't, but we can see about adding another callback if there's a genuine use case), what would you do? Keep in mind, you're still not allowed to touch scopes or the DOM from |
A states onEnter callback is executed before the template is added to the DOM. In the UI router docs, one of the examples shows a modal dialog being triggered in the state onEnter callback. This is fine, but in the example, the modal doesn't rely on the template being in the DOM already. So, according to the docs, the onEnter/onExit is a good place to open/close a modal dialog, but the states template should be in the DOM by the time the onEnter callback is fired.
The text was updated successfully, but these errors were encountered: