Getting Error "Mat-Nav-List Is Not a Known Element"
Used @Angular/Material" Version "^5.2.5" 1 5 Answers None of Above Worked for Me. I Had to Include 'Matlistmodule' and It Worked. 3 Make Sure You Have...
Getting error "mat-nav-list is not a known element" , used @angular/material" version "^5.2.5"
5 Answers
None of above worked for me. I had to include 'MatListModule' and it worked.
Make sure you have imported MatListModule and declared it in your imports in the App.Component module. It works for me
Make sure that the component is loading well in the browser, without any imports yet.
Now follow the implementation as per Docs presented on
If you're confused by the documentation, here's what you should do -
Head to the module of the component and add the following
import { MatSidenavModule } from '@angular/material/sidenav';
and
imports: [
// Other imports
MatSidenavModule
],
Then you can write the HTML code. The Nav should work well.
That's it!
Please let me know if the error persists
In order to overcome the error
<mat-nav-list>
tag is not known as an element, we need to import MatListModule along with MatSidenavModule as
import {MatSidenavModule} from '@angular/material/sidenav';
import {MatListModule} from '@angular/material/list';
It may still help someone I forgot to declare the Component where I use the 'mat-nav-list' in the app-module