[英]Any advice on this angular problem? Mosh tutorial not working for me?
观看https://youtu.be/k5E2AVpwsko并在添加课程部分的大致时间到了 1:35:00。 我得到以下错误。 编译失败。
../src/app/app.component.html:2:1 - 错误 NG8001:“课程”不是已知元素:
2
../src/app/app.component.ts:5:16
5 templateUrl: './app.component.html',
~~~~~~~~~~~~~~~~~~~~~~
Error occurs in the template of component AppComponent.
What am i missing? I tried debugging, but nothing. Any help is appreciated.
您尚未将课程组件声明为应用程序模块的一部分。 在声明数组中,您需要提供它。 您也可以从终端的应用程序模块目录中尝试 ng g 组件课程等 ng 命令,而不是手动创建它,然后自动将其添加到应用程序模块。
您应该删除应用程序组件并使用 ng generate 组件课程。它会自动将该组件添加到您的应用程序模块中。 它既简单又方便。 您还可以观看 angular 组件的文档,这对您的开发很有帮助
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.