我有一个表格,每列上方都有一个下拉列表,其中列数是动态的。我创建了这个如下
<table class='table' >
<tr>
<th ng-repeat= "item in importTable[0]">
<select ng-model="selectedItem" ng-options="i.Name for i in optionList"></select>
</th>
</tr>
<tr ng-repeat="row in importTable">
<td ng-repeat="item in row">{{ item }} </td>
</tr>
</table>
其中 optionList 是下拉列表中的选项列表。所有的下拉菜单都有相同的选项列表。
如何将所选项目及其上方列的索引添加到模型的范围?
这是 JSfiddle http://jsfiddle.net/U3pVM/769/的链接,只需单击导入。我希望能够定义哪一列是哪一类型。