mat-list-item' is not a known element
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:
- If 'mat-list-item' is an Angular component, then verify that it is part of this module.
- 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: - If 'mat-list' is an Angular component, then verify that it is part of this module.
- If 'mat-list' 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@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
Please provide a reproduction in Stackblitz so we can investigate
Try to import {MatListModule} from '@angular/material/list'; it's works
@AnouarBenZahra I did the same. From '@angular/material/list'. its still showing the exact same error as mentioned. My code is the same as the one mentioned in the issue except that i'm not using MatButtonModule and MatCheckboxModule. I'm importing the MatListModule like mentioned above.
This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.