I need to allow the users of my application to change the default route when they want: I have a parameter page where they can select the \"page\" they want to show first wh
Actually you can use guards for this to redirect to correct url before navigation happens:
{ path: '', canActivate: [UserSettingsGuard], redirectTo: 'Day', pathMatch: 'full' }
And you guard can looks like this:
@Injectable()
export class UserSettingsGuard implements CanActivate {
constructor(private router: Router) { }
canActivate() : boolean {
var user = ...;
if(user.defaultPage) {
this.router.navigate([user.defaultPage]);
} else {
return true;
}
}
}
So you can switch to new url when user with overriden page exists or use default flow instead.