Reset MatSelect
What I learned today — 25 September 2018
1 min readSep 25, 2018
One can reset an Angular Material Select component by adding a mat-option
with no value
attribute.
<div class="mat-select-container">
<mat-select placeholder="All">
<mat-option>All</mat-option>
<mat-option *ngFor="let cat of categories" [value]="cat">
{{cat}}
</mat-option>
</mat-select>
</div>
The first, “All”, option has no value and resets the MatSelect.