Home > database >  'app-sidenav-list' is not a known element
'app-sidenav-list' is not a known element

Time:06-27

when I Create sidenav tabs. but getting some errors. errors says Error[importing][2]

'app-sidenav-list' is not a known element:

  1. If 'app-sidenav-list' is an Angular component, then verify that it is part of this module.
  2. If 'app-sidenav-list' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message.

CodePudding user response:

Please check if you have imported the SidenavList component in your app.module.ts.

import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';

import { AppRoutingModule } from './app-routing.module';
import { AppComponent } from './app.component';

import { SideNavList} from './side-nav-list.component';  //Add your component name and path

@NgModule({
  declarations: [
    AppComponent,
    SideNavList     //import your component
  ],
  imports: [
    BrowserModule,
    AppRoutingModule
  ],
  providers: [],
  bootstrap: [AppComponent]
})
export class AppModule { }

CodePudding user response:

This typically happens when the component in question has not been added in app.module.ts file. Please verify and confirm accordingly.

  • Related