请稍等 ...
×

采纳答案成功!

向帮助你的同学说点啥吧!感谢那些助人为乐的人

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

新生成的项目,创建了一个组件,这个组件的.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

正在回答 回答被采纳积分+3

插入代码

1回答

felix 2018-01-15 18:25:27

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

0 回复 有任何疑惑可以回复我~
  • 提问者 fdsfsdasfa #1
    默认的是已经引入了这个组件了,但是还是报同样的错误,但不影响程序运行
    回复 有任何疑惑可以回复我~ 2018-01-17 11:38:43
问题已解决,确定采纳
还有疑问,暂不采纳
意见反馈 帮助中心 APP下载
官方微信