ui-router icon indicating copy to clipboard operation
ui-router copied to clipboard

[RFC] Child states instantiating after parent resolves - documentation says otherwise

Open marcghorayeb opened this issue 12 years ago • 7 comments

The ui-router doc states: "The resolve keys MUST be injected into the child states if you want to wait for the promises to be resolved before instantiating the childs."

However, all test's I've been doing (on 0.2.10) seem to point to the fact that child states wait for resolves to finish in a parent state... Is the doc wrong or my test wrong?

In my case it would be extremely helpful for the child states to WAIT for the parent resolves before instantiation, but reading the documentation i was a little scared it wasn't the case.

marcghorayeb avatar Jun 27 '14 10:06 marcghorayeb

You might need to figure out the answer on this one by testing and reviewing the code. I would be interested to know what you find.

hahla avatar Jul 02 '14 19:07 hahla

Pretty sure all resolves are resolved first before any state is shown, regardless if you inject them into child states.

timkindberg avatar Jul 15 '14 04:07 timkindberg

@timkindberg Yes they are. The thing is the documentation says otherwise for children views that do not have any resolve (only their parents. I think it's just a documentation issue.

marcghorayeb avatar Jul 15 '14 09:07 marcghorayeb

The documentation is still a problem for this. I like the way it is now but the documentation needs to be changed.

programmerdave avatar Feb 26 '15 20:02 programmerdave

Hey guys,

From what I can see, the documentation is correct. Here's what happens if you don't inject the resolve into a child: https://dl.dropboxusercontent.com/s/m0r0jorxrthf78v/2015-04-28%20at%2012.27%20PM.png

And with the resolve injected to the child state, notice my second ajax call waits: https://dl.dropboxusercontent.com/s/bmmbue0zb2fm9y1/2015-04-28%20at%2012.28%20PM.png

nathanmarks avatar Apr 28 '15 16:04 nathanmarks

I think the documentation might have been updated based on master, before a release reflecting the changes was pushed. This might account for the lag.

nateabele avatar Apr 29 '15 14:04 nateabele

Closing due to inactivity

eddiemonge avatar Mar 03 '16 22:03 eddiemonge