How to load a component in single parent router-outlet Angular 4?

Viewed 174

I have an Angular 4 application with app.component.html as -

<app-sidebar></app-sidebar>
<app-topbar></app-topbar>
<router-outlet></router-outlet>

Two routes to 2 different components -

  • Parent - /test to TestComponent
  • Child - /test/:id to TestChildComponent

TestComponent is rendered in <router-outlet></router-outlet> of app.component.html.

I would like if TestChildComponent is also loaded into the same application outlet for the specified URL. Is this possible? Or, is there another way to structure it?

0 Answers
Related