【发布时间】:2021-08-21 04:39:44
【问题描述】:
当item为null时,需要在Material Select元素中显示空(None)选项。
<mat-label>Status</mat-label>
<mat-select formControlName="statusId">
<mat-option>None</mat-option>
<mat-option *ngFor="let item of statuses" [value]="item.id">
{{ item.name }}
</mat-option>
</mat-select>
</mat-form-field>```
As seen in above snippet I need to display the "None" option selected by default when the page loads.
【问题讨论】:
标签: html angular angular-material