Angular 2 'component' is not a known element

后端 未结 15 2080
傲寒
傲寒 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:38

    I just had the exact same issue. Before trying some of the solutions posted here, you might want to check if the component really doesn't work. For me, the error was shown in my IDE (WebStorm), but it turned out that the code worked perfectly when i ran it in the browser.

    After I shut down the terminal (that was running ng serve) and restarted my IDE, the message stopped showing up.

提交回复
热议问题