Below pseudo code describes my component tree structure.
<app-root>
<router-outlet name="main">
<Home-component>
<a routerLink="about">About</a> //
<router-outlet name="home"> </<router-outlet>
</Home-component>
</router-outlet>
</app-root>
When user clicks "About" link , the About Component is displayed in
"main" route-outlet , but my intention is to display it in "home" router-outlet,
what needs to be modified to achieve that.
"app-root" component and "Home-component" are part of root module and "AboutComponent" is part of a feature module.
Root Module routing is as below..
RouterModule.forRoot([
{path:'' , component:LoginComponent },
{path:'home' , component:HomeComponent}
]),
and Feature module routing is as below…
RouterModule.forChild([
{path:'about' , component:AboutComponent }
])
Best Answer
follow this pattern for your routes.