Angular “如何禁用”;“用户界面开关”;棱角分明
在某些情况下,我无法禁用我的Angular “如何禁用”;“用户界面开关”;棱角分明,angular,typescript,angular8,Angular,Typescript,Angular8,在某些情况下,我无法禁用我的ui开关。我尝试了[attr.disabled],但对我无效。还有别的办法吗 <ui-switch class="mt-4" checkedLabel="{{'T' | translate}}" size="medium" uncheckedLabel="{{'F' | translate}}"
ui开关
。我尝试了[attr.disabled]
,但对我无效。还有别的办法吗
<ui-switch class="mt-4" checkedLabel="{{'T' | translate}}" size="medium"
uncheckedLabel="{{'F' | translate}}"
formControlName="isApprovalRequired"
[attr.disabled]="(selectedTypeData === 'APPROVAL' ? true : null)"></ui-switch>
它只是
[diabled]
而不是[attr.disabled]
检查文档
工作
<ui-switch checked [disabled]="selectedTypeData === 'APPROVAL' ? true : false"></ui-switch>