this might be a duplicate, but I could not find the answer.
When I try to navigate to router with params, I get the following error: Error: Cannot match any routes. URL Segment: 'order/24'.
My router config is:
const routes: Routes = [
{
path: 'pm', component: PmComponent, canActivateChild: [AuthGuard],
children: [
{path: 'orderlist', component: OrderlistComponent},
{path: 'new-order', component: NewOrderComponent},
{path: 'order/:id', component: OrderComponent},
{path: '**', component: PmDefaultComponent}
]
}
];
in the new-order component I try to navigate to order/:id:
this.router.navigate(['order/', this.orderId]);
I have already tried
this.router.navigate(['/order/', this.orderId]);
Thanks for help.