我有一個< tr>,它通過ng-repeat來控制以傳遞一個對象。其中一個< td>元素是一個文本字段,並且我在$ scope上有一個函數,它返回文本的行數。現在,在一個又一個< TD>同一行中,我想我必須在文本框線條添加儘可能多的選擇框,所以我想是這樣的:AngularJS根據其他td修改td
<table>
<tr ng-repeat="variable in variables">
<td>
<label for="varValues">Choices:</label>
<textarea class="form-control" ng-model="variable.extras" id="varValues" cols="40" rows="5">{{variable.extras}}</textarea>
</td>
<td>
<table>
<tr element-repeat="numberOfRowsForChoiceVariable(variable)">
<select class="form-control" ng-options="">
<option value="">-- Default Skill --</option>
</select>
</tr>
</table>
</td>
我得到只是一個單一的< select>第二列中的元素。當我更改文本字段的內容時,如何使其重新評估?
'numberOfRowsForChoiceVariable()'看起來像什麼? – isherwood 2014-11-24 21:10:24
它根據變量中的行數返回我想要存在的數字選擇框.extras model – Scott 2014-11-25 18:33:20
這個tr應該是一個循環正確次數的ng-repeat。但問題仍然存在,每當變量.extras更改時,如何重寫td元素? – Scott 2014-11-25 18:35:32