1
我有這樣的代碼:angularjs - 動態NG-模型
<!---->
<div ng-repeat="priority in toppriorities">
<table>
<tr>
<td>{{priority}}.</td>
<td>
<table>
<tr>
<td>
<select name="singleSelect" ng-model="APME" ng-change="changedValue(APME,priority)" >
<option ng-repeat="me in mainelements" value="{{me.Recomendation}}">{{me.Title}}</option>
</select>
</td>
<td>
<div ng-model="APMER[priority]">{{APMER[priority]}}</div>
</td>
</tr>
</table>
</div>
我想更新ng-model``APMER[priority]
我選擇之後,從APME
東西更新:
//JS
$scope.changedValue=function(i, priority){
$scope.APMER[priority] = i;
}
- 我有點不能讓
ng-model="APMER[priority]"
上班。 - in
js
-ng-model="APMER[priority]"
,什麼是分配動態變量的正確方法?