p-dropdown 改变value和label 并进行校验的实现
<div class="form-group " style="display: flex;">
<label class="label-width" for="repairPartSelect">*异常抄送角色:</label>
<p-dropdown id="repairPartSelect" required name="repairPart"
#repairPartSelect="ngModel"
[options]="unitsList" [(ngModel)]="ngForm.ccRole" dataKey="id" [filter]="true"
filterBy="label" [optionLabel]="'name'">
</p-dropdown>
<validation-messages [formCtrl]="repairPartSelect"></validation-messages>
</div>
p-multiSelect 多选下拉 ---改变value和label 并进行校验的实现
<div class="form-group " style="display: flex;">
<label class="label-width" for="repairPartSelect">*异常抄送角色:</label>
<p-multiSelect [options]="unitsList" id="repairPartSelect" filter="filter"
optionLabel="name"
dataKey="id" name="repairPart" #repairPartSelect="ngModel" required
[(ngModel)]="ccRole" [virtualScroll]="true" [itemSize]="34"></p-multiSelect>
<validation-messages [formCtrl]="repairPartSelect"></validation-messages>
</div>
网友评论