I have Three components (NavbarComponent , IndexComponent , PoweredComponent ) so I use lazy loading I need use components in multi components ,I don't know how to declare the component for using it in the lazy module. I'll show you some of the relevant parts of the different files:
declarations: [NavbarComponent],
imports: [
CommonModule
],
exports: [NavbarComponent]
})
declarations: [IndexComponent ,NavbarComponent],
imports: [
CommonModule,
IndexRoutingModule,
],
})
index.component.html
<app-navbar></app-navbar>
<div>...</div>
in index show navbar
@NgModule({
declarations: [PoweredComponent,NavbarComponent],
imports: [
CommonModule,
PoweredRoutingModule,
],
})
powered.component.html
<app-navbar></app-navbar>
<div>...</div>
in powered.component.html
no show navbar
issue
<app-navbar></app-navbar>
not dispaly in multi components can show jsut in index components
Pleas help me???
Thank's to read!!!
Index.module.ts
declarations: [IndexComponent],
imports: [
CommonModule,
IndexRoutingModule,
NavbarModule
],
})
powered.module.ts
@NgModule({
declarations: [PoweredComponent],
imports: [
CommonModule,
PoweredRoutingModule,
NavbarModule
],
})