I need to pass params to a named outlet, from a default outlet. After passing, all I get is 'undefined'. Here is my code.
[routerLink]="['', { outlets: { secondOutlet: 'messages' }, name: this.userName, lastName: this.userLastName}]"
I receive params with this.
this.route$ = this.route.params.subscribe((params: Params) => {
this.name= params['name'];
this.lastName= params['lastName'];
});
I get no error, but in console, all I get is undefined. I can send params to a route if it is on the same outlet, but I cant figure out how to do it by sending params from one outlet to another.
[routerLink]="['', { outlets: { secondOutlet: ['messages', this.userName ] } }]"
and in route specification
Routes = [
{
path: 'messages/:username',
component: AccountsEditComponent,
outlet: 'secondOutlet'
}
]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With