Skip to content

mat-list-item' is not a known element #14936

@scriptsure

Description

@scriptsure

Getting following issue when trying to import list:

ERROR Error: Uncaught (in promise): Error: Template parse errors:
'mat-list-item' is not a known element:

  1. If 'mat-list-item' is an Angular component, then verify that it is part of this module.
  2. If 'mat-list-item' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message. ("
    [ERROR ->]<mat-list-item *ngFor="let video of videos">
    {{video.title}}
"): ng:///DashboardModule/VideoDashboardComponent.html@1:2 'mat-list' is not a known element: 1. If 'mat-list' is an Angular component, then verify that it is part of this module. 2. If 'mat-list' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message. ("[ERROR ->] {{video.title}} "): ng:///DashboardModule/VideoDashboardComponent.html@0:0

I have also tried to directly import from @angular/material/list but it is giving the same error.

What are the steps to reproduce?

import {MatButtonModule, MatCheckboxModule, MatToolbarModule, MatListModule} from '@angular/material';

@NgModule({
declarations: [
AppComponent
],
imports: [
MatToolbarModule,
MatButtonModule,
MatCheckboxModule,
MatListModule,
BrowserModule,
AppRoutingModule,
BrowserAnimationsModule
],

Which versions of Angular, Material, OS, TypeScript, browsers are affected?

7.2.2

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions