我创建了一个组件模块,并将其导入到app.module.ts中。
component / component.module.ts:
// import stuff........
@NgModule({
declarations: [
ComponentA,
ComponentB,
ComponentC
],
imports: [
IonicModule,
PipesModule
],
exports: [
ComponentA,
ComponentB,
ComponentC
],
entryComponents: [
SearchTabComponent
],
schemas: [CUSTOM_ELEMENTS_SCHEMA]
})
export class ComponentsModule { }
app.module.ts
@NgModule({
declarations: [
MyApp,
PageA,
PageB
],
imports: [
BrowserModule,
IonicModule.forRoot(MyApp, { tabsHideOnSubPages: true }),
IonicStorageModule.forRoot(),
AuthModule,
HttpModule,
PipesModule,
ComponentsModule,
DirectivesModule,
IonicImageViewerModule
],
bootstrap: [IonicApp],
entryComponents: [
MyApp,
PageA,
PageB
],
providers: []
})
export class AppModule { }
该应用程序运行正常,但是在.html部分中,它表明它不是模块的一部分。