In angular 1.*, I was using ui-router and was able to pass NON URL Parameters from one state to another. By NON URL Parameter, I mean passing some parameters that does NOT appear on the URL (so completely transparent for the user).
The way to do this in Angular 1.* was by defining a state like this (stateToRedirect is the non-url parameter)
$stateProvider
.state('LOGIN_STATE', {
url: `login`,
component: 'login',
params: {
stateToRedirect: 'home'
}
});
And changing state like this:
$state.go('LOGIN_STATE', {
stateToRedirect: 'OTHER_STATE',
});
In the LOGIN_STATE, I was able to access this parameter doing this:
$stateParams.stateToRedirect;
I'm trying to find the same behaviour for Angular 2 Router, my understanding is that Angular 2 Router has improved a lot and we might not need to use ui-router-ng2.
So my question is: How do you reproduce the above behaviour in Angular 2 Router ?
This question seemed to be what I wanted but I don't want paramter in the URL and the 'data' property on the route seems good but I can't find documentation on how to set it dynamically.