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

1k Views Asked by At

when I create sidenav tabs. but getting some errors while using it into HTML.

To check the error please find the screenshot as- Error

To check the module imports file please check the screensot - app.module.ts

'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.
2

There are 2 best solutions below

0
jabin jaman On

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 { }

0
Harsh Singla On

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