You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This may be a duplicate to isue #73 OR I'm really getting something wrong ;-)
I'm having trouble resolving the following issue:
My application looks like this:
Parent State
Sub State 1
Sub State 2
At application startup, I initially need to make an http request to get the role of the current user. The role is then added as a query parameter to all sub sequent http requests. I had the feeling that I needed to do such an initial call within the resolve-part of the Parent State. Is this even the right place for such initial data requests? I can't load the data in module.run() since the states won't wait for async data loaded there. I really need all the states to wait, until the initial data has been loaded. Doing this within the resolve-part of the Parent State does obviously not work since ui-router resolves all states in parallel (as stated by Karsten in issue #73 ), thus the sub-states would crash because the role has not been loaded.
Has anyone a better idea where to load such initial data before the states are loaded?
Thanks for your help!
Cheers Michael
The text was updated successfully, but these errors were encountered:
Once #73 is fixed this should work as you intend it to. Resolves will happen in parallel as much as possible, but will still respect explicit dependencies between the functions.
Hi all!
This may be a duplicate to isue #73 OR I'm really getting something wrong ;-)
I'm having trouble resolving the following issue:
My application looks like this:
At application startup, I initially need to make an http request to get the role of the current user. The role is then added as a query parameter to all sub sequent http requests. I had the feeling that I needed to do such an initial call within the resolve-part of the Parent State. Is this even the right place for such initial data requests? I can't load the data in module.run() since the states won't wait for async data loaded there. I really need all the states to wait, until the initial data has been loaded. Doing this within the resolve-part of the Parent State does obviously not work since ui-router resolves all states in parallel (as stated by Karsten in issue #73 ), thus the sub-states would crash because the role has not been loaded.
Has anyone a better idea where to load such initial data before the states are loaded?
Thanks for your help!
Cheers Michael
The text was updated successfully, but these errors were encountered: