小编Pra*_*pur的帖子

如何限制用户在角度材料设计中最多选择 5 个选择 <mat-select multiple>

我想让用户在 中选择不超过 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.

typescript angular-material angular

1
推荐指数
1
解决办法
1467
查看次数

标签 统计

angular ×1

angular-material ×1

typescript ×1