Angular compiler报的一个错误消息:Component XX is not part of any NgModule

简介: Angular compiler报的一个错误消息:Component XX is not part of any NgModule

Error in /turbo_modules/@angular/compiler@9.1.12/bundles/compiler.umd.js (29363:23)

Component ProductListComponent is not part of any NgModule or the module has not been imported into your module.


image.png

错误分析

app.module.ts里,只import了ProductListComponent,但却未申明到declarations区域内:image.png

添加之后错误消失:

image.png

相关文章
|
5月前
|
Web App开发 UED 开发者
谈谈企业级 Angular 应用的二次开发 - 基于 Angular Component 替换的 Extensibility 支持案例介绍
谈谈企业级 Angular 应用的二次开发 - 基于 Angular Component 替换的 Extensibility 支持案例介绍
|
5月前
|
编译器 API 开发者
Angular Component ɵcmp 属性的含义和使用场合介绍
Angular Component ɵcmp 属性的含义和使用场合介绍
|
5月前
|
API 开发者
Angular Component class ɵfac 的属性介绍
Angular Component class ɵfac 的属性介绍
|
12月前
|
JavaScript 数据安全/隐私保护 开发者
Angular Component Class 成员属性默认的访问权限控制
Angular Component Class 成员属性默认的访问权限控制
|
JavaScript Shell
使用 RxJs 实现一个支持 infinite scroll 的 Angular Component
使用 RxJs 实现一个支持 infinite scroll 的 Angular Component
|
5月前
Angular多个页面引入同一个组件报错The Component ‘MyComponentComponent‘ is declared by more than one NgModule怎么办?
Angular多个页面引入同一个组件报错The Component ‘MyComponentComponent‘ is declared by more than one NgModule怎么办?
|
5月前
|
JavaScript
Angular Component 内 set 关键字的使用
Angular Component 内 set 关键字的使用
|
11月前
|
前端开发 JavaScript 测试技术
什么是 Angular 的 Custom component
什么是 Angular 的 Custom component
|
12月前
|
测试技术 API 开发者
关于 Angular Component ChangeDetectionStrategy.OnPush 策略
关于 Angular Component ChangeDetectionStrategy.OnPush 策略
|
12月前
|
JavaScript
关于 Angular 应用里 Component 继承和 Override 的一个实际例子
关于 Angular 应用里 Component 继承和 Override 的一个实际例子
下一篇
无影云桌面