如何在 angular 中禁用 "ui-switch"

How to disable "ui-switch" in angular

在某些情况下我无法禁用我的 ui-switch。我试过 [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] 检查文档 here

<ui-switch checked [disabled]="selectedTypeData === 'APPROVAL' ? true : false"></ui-switch>

工作stackblitz