Answers for "app is not a known element angular error"

0

app is not a known element angular error

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.
Posted by: Guest on October-21-2021

Code answers related to "app is not a known element angular error"

Code answers related to "Javascript"

Browse Popular Code Answers by Language