我有一个应用程序模块和一个功能模块。在功能模块中声明了一个名为“AudioPlayerComponent”的组件。我想在应用程序模块中使用它,但它没有显示。没有错误。
我错过了什么吗?
应用模块:
@NgModule({
imports: [
BrowserModule,
HomeModule,
ReciterModule, // the feature module which has the audio player
routing
],
declarations: [
AppComponent,
NavComponent
],
providers: [
appRoutingProviders,
AudioPlayerService
],
bootstrap: [AppComponent]
})
功能模块:
@NgModule({
imports: [
CommonModule,
FormsModule,
HttpModule,
reciterRouting
],
declarations: [
ReciterDetailComponent,
WidgetComponent,
AudioPlayerComponent // this is the component I want to also use in the app component
],
providers: [
AppService,
RecitersService
]
})
功能模块中使用音频播放器(节目)的组件
<div class="reciter-detail">
...
<audio-player></audio-player>
</div>
尝试使用音频播放器的应用程序组件(不显示):
<nav-main></nav-main>
<div class="container">
<router-outlet></router-outlet>
<audio-player></audio-player>
</div>