我有两个模块,我想使用另一个CommonSharedModule
模块中的PrivateModule
模块中的组件
当我在模块中使用选择器时出现此错误
如果'product-information'是Angular组件,请验证它是此模块的一部分。
CommonSharedModule
const MODULE_COMPONENT = [
ProductInformationComponent
];
@NgModule({
declarations: MODULE_COMPONENT,
imports: [
CommonModule
],
exports: MODULE_COMPONENT
})
export class CommonSharedModule { }
PrivateModule
const MODULE_COMPONENT = [
PrivateComponent
];
@NgModule({
declarations: MODULE_COMPONENT,
imports: [
CommonModule,
LayoutModule,
ProductModule,
PrivateRoutingModule,
CommonSharedModule
]
})
export class PrivateModule { }
product-information
同时添加到declarations
的exports
和CommonSharedModule
数组中>