NbMenu doesn't show when app load into child component, pls help me!
- Linguagem predominante
- TypeScript
- Estrelas
- 8.1k
- Forks
- 1.5k
- Métricas de merge de PRs
- Nenhum PR com merge em 30d
Descrição
### Issue type
**I'm submitting a ...** (check one with "x")
* [x] bug report
* [ ] feature request
### Issue description
**Current behavior:**
I'm using Lazy-Loading for my app, but when it loads into the child component, NbMenu is only shown with a component (IndexComponent), but the other component of the Post module (create, update, detail) doesn't work with NbMenu. I also implemented NbMenu in the Feature and Root module, but It hasn't worked. I don't know what happened
**Related code:**
RootModule
```
@NgModule({
declarations: [
AppComponent
],
imports: [
BrowserModule,
AppRoutingModule,
NbSidebarModule.forRoot(),
NbMenuModule.forRoot(),
NbThemeModule.forRoot()
],
providers: [],
bootstrap: [AppComponent]
})
export class AppModule { }
```
AdminModule
```
@NgModule({
declarations: [AdminComponent],
imports: [
CommonModule,
AdminRoutingModule,
NbIconModule,
NbLayoutModule,
NbMenuModule,
NbSidebarModule,
NbEvaIconsModule,
PostModule,
NbDialogModule.forChild(),
NbWindowModule.forChild()
],
providers: [NbThemeService, NbSidebarService]
})
export class AdminModule { }
```
PostModule
```
@NgModule({
declarations: [PostComponent, CreateComponent, DetailComponent, UpdateComponent, IndexComponent],
imports: [
CommonModule,
NbCardModule,
NbButtonModule,
Ng2SmartTableModule,
NbIconModule,
HttpClientModule,
FormsModule,
NbMenuModule,
NbSidebarModule,
NbEvaIconsModule,
PostRoutingModule
],
providers: [PostService]
}
)
export class PostModule { }
```
PostRoutingModule
```
const routes: Routes = [
{
path: '', component: PostComponent, children: [
{ path: '', redirectTo: 'index', pathMatch: 'full' },
{ path: 'index', component: IndexComponent, pathMatch: 'full' },
{ path: 'create', component: CreateComponent, pathMatch: 'full' },
{ path: 'update', component: UpdateComponent, pathMatch: 'full'},
{ path: 'detail', component: DetailComponent, pathMatch: 'full'}
]
}
]
@NgModule({
imports: [
RouterModule.forChild(routes)
],
exports: [RouterModule],
}
)
export class PostRoutingModule { }
```
Guia de contribuição
Avaliação
Esta issue ainda não foi avaliada.