Closed stevie-p closed 8 years ago
I'm looking for an answer to this question, too. In fact, the Future States features seems pretty useless to me if there is no way to dynamically get the url parameters and, depending on them, create the state structure needed.
Are we missing something?
Does ui-router-extras not cover this use case?
Future states does not support this use case, sorry.
Actually I've found out that you can simply get the url params like this:
var params = futureState.urlMatcher.exec($location.$$url);
That probably won't work with $state.go like a ui-sref
I have a use case to dynamically (at run time) load a new state tree, triggered by user navigation from either inside (e.g. via ui-sref) or outside (via url) the app.
So I think the FutureStates module of ui-router-extras should be the way to go.
But the states I need to load dynamically are based on a state parameter, i.e. an ID. For instance:
The Substates will be different depending on the ID.
So, while I can dynamically create a newState state, how can I pass a $stateParam (or similar) to the StateFactory function so that it can dynamically load the correct substates?
Does ui-router-extras not cover this use case?