Here I define the route in the angular 10 project:
const routes: Routes = [
{ path: '', component: component1},
{ path: 'myComponent/:dataId', component: component2}
];
I also have this array:
let myArr:string = ["5","4","7","2"]
In route, I pass dataId as a parameter as you can see above but I also need to pass myArr in the route as a parameter.
My question is how to pass an array of string as a parameter in route?
routerLinkcan helprouterLink="['/myComponent/:dataId/', {arrValues:[myArr}]"I had saved this link a while ago stackblitz.com/edit/angular-jeqbbd