<xxx>不是已知的元素。请确认它是此模块的一部分

时间:2019-01-31 09:55:08

标签: angular ionic3

我创建了一个组件模块,并将其导入到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部分中,它表明它不是模块的一部分。

0 个答案:

没有答案