route array
const routes: Routes = [
...
{path:'exam-list',component: ExamListComponent},
{path:'exam-panel/:Id',component: ExamPanelComponent}
..
];
array imported
@NgModule({
imports: [RouterModule.forRoot(routes)],
click event
onSelect(examdetails)
{
this.router.navigate(['exam-panel',examdetails.Id])
}
on click event onselect()
I got this error Error: Uncaught (in promise): Error: Cannot match any routes. URL Segment: 'exam-panel' with parameter when I am using routerLink it's work fine but on click event is not working with router.navigate
when i am using [routerLink]="['/exam-panel/',examdetails.Id]" it's working but when I am using "router.navigate" it naviagte first route exam-panel with parmeter ok, then automatically route to home page