I would like to know how I can click the navigation element in the base template and load the required component download into the child socket of the router.
You can achieve this by including nested routes, you need to set the property childrento Routes. Here is the doc .
Here's how to do it, especially for your use case from plunkr.
src/app.ts , Routes. , Child2Component ChildComponent
export const ROUTES: Routes = [
{
path: '',
component: HomeComponent
},
{
path: 'child',
component: ChildComponent,
children : [
{ path: 'child2', component: Child2Component }
]
},
{
path: 'home',
component: HomeComponent
}
];
Child2Component,
<a [routerLink]="['/child', 'child2']">Go to Child - Child2</a>
, , ChildComponent Child2Component router-outlet ChildComponent
plunkr