There is a new method what came with Angular 7.2.0
https://angular.io/api/router/NavigationExtras#state
Send:
this.router.navigate(['action-selection'], { state: { example: 'bar' } });
Receive:
constructor(private router: Router) {
console.log(this.router.getCurrentNavigation().extras.state.example); // should log out 'bar'
}
You can find some additional info here:
https://github.com/angular/angular/pull/27198
The link above contains this example which can be useful: https://stackblitz.com/edit/angular-bupuzn