<div class="pw-form-control-text" id="disclosureQuestionsPrepopulate" name="disclosureQuestionsPrepopulate" ng-repeat="type in (prepopulatingFieldData|prepopulateValue:'c2a39346-9e95-e411-bd87-00155d005107')" >
<div >
<input name="{{type.Id}}" ng-model="formData.disclosureQuestionsPrepopulate"($index + 1) ng-click="option.selected = true" type="radio" value=true >Yes</input>
</input>
这里我要做的是我的ng-model名称应该是这样的
像这样,但它不起作用。 有人能帮助我吗?formData.disclosureQuestionsPrepopulate1" , formData.disclosureQuestionsPrepopulate2
答案 0 :(得分:2)
应使用[]
为ng-model
变量&amp;分配创建数组Value属性也应为ng-value
,以确保与复选框绑定
<强> HTML 强>
<input ng-attr-name="{{type.Id}}"
ng-model="formData['disclosureQuestionsPrepopulate'+($index + 1)]"
ng-click="option.selected = true" type="radio" ng-value="true"/>Yes