【发布时间】:2020-07-22 06:54:58
【问题描述】:
我尝试使用角度选择材质,我需要将图标动态添加到选项中并在选择时显示它 我的 ts 代码:
<mat-form-field>
<mat-select disableOptionCentering panelClass="dropDown-panel" (selectionChange)="onRoomChange($event.value)">
<mat-option *ngFor="let type of roomTypes" [value]="type.roomTypeId">
{{ type.faName }}
<mat-icon>{{ type.icon }}</mat-icon>
</mat-option>
</mat-select>
</mat-form-field>
【问题讨论】: