compareWith指令中角度4

compareWith指令中角度4

问题描述:

角度4介绍compareWith指令来比较options来选择。compareWith指令中角度4

<select [compareWith]="byUId" [(ngModel)]="selectedUsers"> 
    <option *ngFor="let user of users" [ngValue]="user.UId">{{user.name}}</option> 
</select> 

这仅适用于select控制?或者是否可以使用其他控件?如果是的话,那该怎么办呢?

这仅限于select标签。以下是GitHub上的原始拉取请求https://github.com/angular/angular/pull/13349