【发布时间】:2021-06-03 20:56:55
【问题描述】:
我已经尝试过 [禁用] 或禁用。它不能根据我在 typescript 中的条件工作。我有大约 4 个按钮,我需要根据我的 typescript 条件来实现它。我的要求是禁用按钮基于打字稿条件。我有大约 7 个条件需要评估。到目前为止,无论条件如何,按钮都会被禁用。请建议我任何其他方法来实现它
**HTML**
<button type="button" [disabled]="isButtonDisabled"
style="background: #79CEA4 !important;color: #FFFFFF !important;font-size: 13px;font-weight: 600;margin-right: 20px"
class="btn btn-lg" (click)="finish()">FINISH</button>
**TS**
isButtonDisabled:boolean;
for (var EmployeeList of Employee){
if ((EmployeeList.EmployeeStatus== 'Active') {
this.isButtonDisabled= false;
return 'circle3';
}
else if((EmployeeList.EmployeeStatus== 'Inactive') {
this.isButtonDisabled= true;
return 'circle1';
}
【问题讨论】:
标签: angular