Closed chrisguerrero closed 8 years ago
I think that's a tricky one. This is a problem core to ui-router itself, which is in turn exposed by future state registration order.
My best idea is to register ONE future state (i.e., /{username}
) and then register BOTH states in the proper order with your Future State Factory.
Hi all,
I'm using UI Router future states along with webpack and ocLazyLoad to dynamically download and execute modules. In my future state factory for each module, I register the entire state tree for the module using UI Router's $stateProvider.
My question is about the order in which states are registered. Given the following future states:
/jobs
/{username}
The future state loading works correctly if I visit
/jobs
first, and then navigate to/chris
. However, if I visit/chris
first, the/{username}
state is registered with UI router before/jobs
, so when I navigate to/jobs
it attempts to load the/{username}
route.Is there any way to make sure
/{username}
always comes last, even if/jobs
is registered after?Thanks!