Send data through routing paths in Angular

Is there anyway to send data as parameter with router.navigate?
I mean, something like this example, as you can see the route has a data parameter, but doing this it’s not working:

this.router.navigate(["heroes"], {some-data: "othrData"})

because some-data is not a valid parameter. How can I do that? I don’t want to send the parameter with queryParams.

7 Answers
7

Leave a Comment