根据 Angular 弹出窗口中的条件禁用单选按钮?
Disable radio button based on condition in Angular popup?
我正在尝试在某些条件成立时禁用单选按钮。这是 link 我的弹出窗口将通过它打开:
<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
,我不知道为什么。在上面的函数中,我得到了一个值,我将其传递给禁用单选按钮。有人能帮助我吗?谢谢!
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>
我正在尝试在某些条件成立时禁用单选按钮。这是 link 我的弹出窗口将通过它打开:
<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
,我不知道为什么。在上面的函数中,我得到了一个值,我将其传递给禁用单选按钮。有人能帮助我吗?谢谢!
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>