Angular 2 'component' is not a known element

后端 未结 15 2107
傲寒
傲寒 2020-11-30 17:58

I\'m trying to use a component I created inside the AppModule in other modules. I get the following error though:

\"Uncaught (in promise): Error: Temp

15条回答
  •  清歌不尽
    2020-11-30 18:55

    I was facing the same issue. In my case I have forgotten to declare Parent component in the app.module.ts

    As a example if you are using selector in ToDayComponent template, you should declare both ToDayComponent and DatepickerComponent in the app.module.ts

提交回复
热议问题