akveo / akveo/nebular

NbMenu doesn't show when app load into child component, pls help me!

Đang mở
#2,680 0 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
TypeScript
Star
8.1k
Fork
1.5k
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

### 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 { }
```

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.