如何将下拉列表中所选值的名字与下拉列表中所有项目的名字进行比较,如果不匹配,则会在下拉列表中禁用该元素。
employee[
{"id":1001,"name":"robin_010"},
{"id":1002,"name":"robin_020"},
{"id":1003,"name":"robin_030"},
{"id":1004,"name":"sushil_040"},
{"id":1005,"name":"sushil_050"},
]
下拉显示在这里
<mat-form-field>
<mat-select [(value)]="val" [formControl]="toppings" multiple>
<mat-option *ngFor="let emp of employee" [value]="emp" >{{emp.name}}</mat-option>
</mat-select>
</mat-form-field>
请帮助