angular - 不是已知元素。请确认它是此模块的一部分
问题描述
我创建了一个组件模块并将其导入 app.module.ts。
组件/组件.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 部分显示它不是模块的一部分。
解决方案
推荐阅读
- powershell - 具有 UTF-8 编码的 Powershell 字符串变量
- templates - 为什么模板没有注册?
- excel - 如何找到下一个可用列并对其应用公式
- javascript - 我正在尝试使用从 php 数据库中提取的一些数据作为可点击 SVG 图片(javascript)中的信息
- swift - Swift:听 url 属性然后下载照片
- python - 加速图像上的逐像素操作
- vb.net - name.split 基于具有某些相同字符的多个分隔符
- r - 对注释扩展功能的惰性求值
- sql-server - 改进 SQL Server 条件连接
- php - 我想打印关联数组值