I am trying to use an Angular Material (7.0) selection list as described here.
The example code snippet on the page is
<mat-selection-list #shoes>
<mat-list-option *ngFor="let shoe of typesOfShoes">
{{shoe}}
</mat-list-option>
</mat-selection-list>
<p>
Options selected: {{shoes.selectedOptions.selected.length}}
</p>
with the typesOfShoes
defined in the TS file, as described in their snippet:
export class HomeComponent implements OnInit {
typesOfShoes: string[] = ['Boots', 'Clogs', 'Loafers', 'Moccasins', 'Sneakers'];
constructor() {}
ngOnInit() {}
}
Makes sense to me, but when I try to compile I get the Error:
ERROR in: Can't bind to 'ngForOf' since it isn't a known property of 'mat-list-option'.
1. If 'mat-list-option' is an Angular component and it has 'ngForOf' input,
then verify that it is part of this module.
2. If 'mat-list-option' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA'
to the '@NgModule.schemas' of this component to suppress this message.
etc.
I have imported MatListModule
into my app module.
I see no further modules related to list options to import.
What am I missing here?