新生成的项目为什么会报错Error:(3, 2) ng: Component

来源:6-5 组件生命周期钩子概述

fdsfsdasfa

2018-01-15

新生成的项目,创建了一个组件,这个组件的.component.ts组件就会报错


Error:(3, 2) ng: Component 'LifeComponent' is not included in a module and will not be available inside a template. Consider adding it to a NgModule declaration

写回答

1回答

felix

2018-01-15

在@NgModule这个组件装饰器里引入

0
1
fdsfsdasfa
默认的是已经引入了这个组件了,但是还是报同样的错误,但不影响程序运行
2018-01-17
共1条回复

Angular4.0从入门到实战 打造股票管理网站

Angular新特性,教你熟练使用 Angular 和 Typescript 开发组件式单页应用

2683 学习 · 1361 问题

查看课程