首页 > 解决方案 > 单击角度 12 中的每个 formArray 元素后,如何禁用 formArray 的特定单击事件?

问题描述

<div formArrayName="addGrp">
    <div id="ifElse_block" class="create-rules-section" *ngFor="let grp of addGrp().controls; let k=index" [formGroupName]="k">
        <div formGroupName="ifBlockRule" class="ifBlockRule">
             <!-- how disable below button after one click in each array element-->
             <button mat-raised-button color="primary" type="button" class="addGrpCond" (click)="ifBlockAddGrpCondition(k)" [disabled]="addGrpBtnclicked" title="Add group condition">
             <mat-icon>add</mat-icon>
             </button>
             <!-- how disable above button after one click in each array element-->
        </div>
    </div>
</div>

单击数组元素后如何禁用注释行中提到的按钮?我是角度的新手。

标签: angularformarrayformgroups

解决方案


推荐阅读