router navigate pass params code example
Example 1: router navigate pass params
this.router.navigate(['action-selection'], { state: { example: 'bar' } });
...
constructor(private router: Router) {
console.log(this.router.getCurrentNavigation().extras.state.example);
}
Example 2: router navigate pass params
this.router.navigate(['action-selection'], { state: { example: 'bar' } });
...
constructor(private router: Router) {
console.log(this.router.getCurrentNavigation().extras.state.example);
}
Example 3: router navigate pass params
this.router.navigate(['action-selection'], { state: { example: 'bar' } });
...
constructor(private router: Router) {
console.log(this.router.getCurrentNavigation().extras.state.example);
}