F
F
FNY3PM2021-04-13 15:55:27
Angular
FNY3PM, 2021-04-13 15:55:27

How to change the parent component?

There is a module:

@NgModule({
  declarations: [ModuleLayoutComponent],
  imports: [
    CommonModule,
    RouterModule.forChild([{path: '', pathMatch: 'full', component: ModuleLayoutComponent, children: [
      {path: '/order', component: OrderComponent},
      {path: '/payment', component: PaymentComponent}
    ]}])
  ],

})


ModuleLayoutComponent
<header></header>
<div class="content">
    <router-outlet></router-outlet>
</div>
<footer></footer>


How to make sure that the ModuleLayoutComponent does not show the footer when the PaymentComponent is shown in the router-outlet, i.e. the current path is '/path'.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question