我有几个数组,正在循环它们以构建一个表。第一个标题行是列名数组,第二个标题行是用户将用来选择以映射到上述列名的选择框
<h2>CSV Parser</h2>
<div class="alert alert-info" ng-if="helpText">
{{helpText}}
</div>
<table class="table table-striped table-hover">
<thead>
<tr>
<th ng-repeat="col in data.cols track by $index">{{col}}</th>
</tr>
<tr>
<th ng-repeat="col in data.cols track by $index">
<select class="form-control"
ng-options="colToMap as colToMatch for colToMatch in colsToMatch"
ng-change="setColMap($index,colToMap)"
ng-model="lastFieldSet[$index]">
<option value="">Select Field</option>
</select>
</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="row in data.rows track by $index">
<td ng-repeat="text in row track by $index">{{text}}</td>
</tr>
</tbody>
</table>
当我更改任何选择时,更改功能根本不会触发,但如果我将其更改为单击,它会触发。lastFieldSet[] 模型在任何时候都不会更新。
关于这里发生了什么的任何想法?