根据Angular弹出窗口中的条件禁用单选按钮?

时间:2019-11-25 14:17:38

标签: angular angular6

如果某些情况成立,我将尝试禁用单选按钮。这是打开我的弹出窗口的链接:

<a style="text-decoration: underline; text-align: left; white-space: pre-wrap;" class="btn btn-flat btn-small" data-toggle="modal" data-target="#CancelContinuecopytogroupPopupModel" (click)="passReqIdforcopytogroup(requestDetail,groupData,solutionData,)"><b>Copy To another Group</b></a>

这是显示此单选按钮的弹出代码(只是添加了单选输入而不是整个弹出源代码)

<label for="{{radio1.id}}" class="radio" (click)="radioSelected(radio1.label)">
 <input type="radio" id="{{radio1.id}}" [disabled]="solutionData.ReqGroupName == 'some'" name="optionsRadio41" value="{{radio1.value}}" required="" checked="{{radio1.checked}}">
 <i class="skin"></i>
<span>Copy Within this solution</span>
</label>

这是我的功能,通过它我将详细信息传递给弹出窗口以供显示:

passReqIdforcopytogroup(nxRequestId,solutionData,groupData){
        this.ReqId = RequestId;
        this.ReqGroupId = groupData;
        this.GroupRequestDesc = groupData;
        this.SolutionId = solutionData.SolutionId;
        this.ReqGroupName = solutionData.ReqGroupName;
    }

这给了我undefined,我不知道为什么。在上面的函数中,我获取了一个值,将其传递给它以禁用单选按钮。谁能帮助我?谢谢!

1 个答案:

答案 0 :(得分:0)

passReqIdforcopytogroup(nxRequestId,solutionData,groupData){
        this.ReqId = RequestId;
        this.ReqGroupId = groupData;
        this.GroupRequestDesc = groupData;
        this.SolutionId = solutionData.SolutionId;
        this.ReqGroupName = solutionData.ReqGroupName;
    }

<label for="{{radio1.id}}" class="radio" (click)="radioSelected(radio1.label)">
 <input type="radio" id="{{radio1.id}}" [disabled]="ReqGroupName == 'some'" name="optionsRadio41" value="{{radio1.value}}" required="" checked="{{radio1.checked}}">
 <i class="skin"></i>
<span>Copy Within this solution</span>
</label>

<a style="text-decoration: underline; text-align: left; white-space: pre-wrap;" class="btn btn-flat btn-small" data-toggle="modal" data-target="#CancelContinuecopytogroupPopupModel" (click)="passReqIdforcopytogroup(requestDetail,solutionData,groupData)"><b>Copy To another Group</b></a>