I want to pass parameters to another page, this way:
const navParams:NavigationExtras = {state: {functionalityId:'my id'}};
this.router.navigate(['processes'], navParams);
but it gives me the following error:
Type '{ state: { functionalityId: string; }; }' is not assignable to type 'NavigationExtras'.
Object literal may only specify known properties, and 'state' does not exist in type 'NavigationExtras'.
I've also tried to pass parameters directly inside navigate:
this.router.navigate(['processes'], {functionalityId:'my id'});
but I have the (almost) same error:
Argument of type '{ functionalityId: string; }' is not assignable to parameter of type 'NavigationExtras'.
Object literal may only specify known properties, and 'functionalityId' does not exist in type 'NavigationExtras'
Your syntax is wrong. You need the end square bracket to be placed towards the end of the line, like this: this.router.navigate(['processes', { functionalityId: 'my id' }])
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