0
<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

像那样,但它不起作用。有人能帮我吗?

4

1 回答 1

2

它应该用于[]ng-model变量分配创建一个数组,并且值属性应该是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
于 2015-02-23T05:43:09.563 回答