I\'m building angular2 app and currently I have an home component with navbar, toolbar and router-outlet for the main content. I want to add one extra page for the login mechani
The key is using child routes
import { RouterModule, Route } from '@angular/router';
const ROUTES: Route[] = [
{ path: 'home', component: HomeComponent },
{ path: 'notes',
children: [
{ path: '', component: NotesComponent },
{ path: ':id', component: NoteComponent }
]
},
];
@NgModule({
imports: [
RouterModule.forRoot(ROUTES)
]
})
see more here the-three-pillars-of-angular-routing