How to retrieve params passed as NavigationExtras using navigateByUrl as described below from the target component in Angular ?
let extras: NavigationExtras = {
queryParams : {
errorTitle: 'Erreur Technique',
errorBody: 'URL erronée'
}
};
this.router.navigateByUrl(RoutesUrl.ERROR, extras);
The solution that I found is suggested by
soulfreshin this GitHub issue : https://github.com/angular/angular/issues/18798I call my route this way :
then I retrieve query params this way :
or
UPDATE
If you don't want that your
queryParamsappears in the address bar (URL) you can use :Sending data :
Retrieving data :