-1

I have the following routes, and I need to render the Conditional component in some specific routes, but the shared component in all routes. How can I do it?

const routes: Routes = [ { path: "someroute", component: ConditionalComponent,
children: [{ path: '', component: SharedComponent }],

} ];

Lazarus
  • 75
  • 1
  • 1
  • 4

1 Answers1

0

If I understand the question correctly, you should be able to have

const routes: Routes = [
    { 
        path: "someroute",
        component: ConditionalComponent
    }
];

And in your app.component.html you should have

<router-outlet></router-outlet>
<shared-component></shared-component>
TSiders
  • 1
  • 1