Angular2: how can i navigate to children from component.ts
I am on the homepage / home and want to navigate to kids / sheets.
we usually write this.route.navigate (['home']); but how do I write it from children to get the path as localhost: 4200 / home / unitsheet
const ROUTER_DATA: Routes = [
{ path:'login', component: LoginComponent},
{ path:'home', component: HomeComponent, children: [
{ path:'unitsheet', component: unitComponent},
]},
{ path:'', redirectTo:'login', pathMatch: 'full'}
]
+3
source to share