我想让用户在 中选择不超过 5 个选择<mat-select multiple>,我将如何实现这一点。
selectionChange我使用的事件,但无法反映用于阻止选择中的用户的 UI,不超过 5 个。
<mat-select [(ngModel)]="orderSearchModel.analystId" name="analyst" (selectionChange)="onChangeAnalyst($event)" multiple>
<mat-option (click)="clearAnalyst()">clear</mat-option>
<mat-option *ngFor="let user of users" [value]="user.value" >{{user.name}}</mat-option>
</mat-select>
Run Code Online (Sandbox Code Playgroud)
我希望用户在我的multi-select.