I have a problem when trying to navigate to a child view by code using the router object within my component :
this.router.navigate(['./details']); //Error: Cannot match any routes: 'details'
But within my template using routerLink, it works : Test me I need to do the same thing but within the component using the router.navigate method. My component is displayed within another one in a routerOutlet, I have the following sub routing config :
export const HOME_ROUTES: Routes = [
{
path: 'home',
component: HomeComponent,
children: [{path: '',outlet: 'route1',component: DashboardComponent,pathMatch: 'full'},
{
path: 'dashboard',
outlet: 'route1',
component: DashboardComponent
},
{
path: 'tasks',
outlet: 'route1',
component: TasksComponent,
children: [
{ path: '',component: TasksListComponent,pathMatch: 'full'},
{ path: 'list',component: TasksListComponent},
{ path: 'details', component: TasksDetailsComponent },
{ path: 'view', component: TasksListComponent },
]
}
]
}
];
And I'm trying to display the TasksDetailsComponent from the TasksListComponent, my relative url is "http://localhost:8000/home/(route1:tasks)
Any help is very appreciated Many thanks