我有一个json
[ { "qpid": "41", "qbid": "4", "presentqb": "banktest",
"difficulty": [ 0, 0, 2, 0, 0 ],
"selQ": [ 0, 0, 0, 0, 0 ] },
{ "qpid": "41", "qbid": "6", "presentqb": "bank 29th",
"difficulty": [ 1, 1, 1, 0, 1 ], "selQ": [ 0, 0, 0, 0, 0 ] } ]
我希望根据json中的enteries数量使用下拉列表。下拉数量取决于selQ。下拉值中的值根据json中的难度而变化。当下拉值改变时,它应该进入json的selQ。 我使用下面的代码
<div class="well" id="selectedQBs" style="height:200px"
ng-repeat="(k,selQB) in selQBs">
<ul>
<li>{{selQB.presentqb}}
<a href ng-click="selQBs.splice($index, 1)">
<span class="btn btn-mini btn-danger"><strong>x</strong></span>
</a>
<div>
<div id="{{selQB.qbid}}"
ng-repeat="sq in selQB.selQ track by $index"
ng-hide="allocationtype == 4">
<select ng-model="selQBs[k].selQ[$index]"
ng-options="n for n in range(selQB.difficulty[$index])">
</select>
</div>
</div>
</li>
</ul>
</div>
通过上面的代码,我无法将下拉列表的更改值与相应的div的selQ绑定