📌  相关文章
📜  app 不是已知的元素角度错误 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:02:00.955000             🧑  作者: Mango

代码示例1
I created a home component that I could not render and kept getting the same error. Here is how I solved it.

I checked the app.module.ts file to see if the component was imported and added to @NgModule declarations. Since it wasn't I added the following:

    import { HomeComponent } from './home/home.component';

    @NgModule({
    declarations: [
    AppComponent,
    HomeComponent
    ]

I'm not sure why it wasn't added when the CLI generated the component but this is was my solution. Let me know if it worked for you or what you ended up finding as a solution.