我有一个名为"建议"的组件,我想在两个不同的页面上呈现.因此,我根据在线资源创建了一个共享模块,并将组件添加到其中,然后我将该模块导入到我需要的两个模块中.但是,当我try 编译时,我得到了如下的错误:
rror: src/app/recommendations/recommendations.component.html:69:5 - error NG8001: 'ion-card-subtitle' is not a known element:
1. If 'ion-card-subtitle' is an Angular component, then verify that it is part of this module.
2. If 'ion-card-subtitle' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message.
69 <ion-card-subtitle>
这些提示如下
@NgModule({
declarations: [
RecommendationsComponent
],
imports: [
CommonModule,
FormsModule,
ReactiveFormsModule,
],
exports: [
RecommendationsComponent
]
})
export class SharedCompsModule { }
模数1
@NgModule({
schemas: [CUSTOM_ELEMENTS_SCHEMA],
imports: [
IonicModule,
CommonModule,
FormsModule,
Tab1PageRoutingModule,
SharedCompsModule
],
declarations: [
Tab1Page,
]
})
export class Tab1PageModule {}
模块2
@NgModule({
schemas: [CUSTOM_ELEMENTS_SCHEMA],
imports: [
IonicModule,
CommonModule,
FormsModule,
Tab3PageRoutingModule,
SharedCompsModule
],
declarations: [
Tab3Page
]
})
export class Tab3PageModule {}
我错过了什么?