我想使用 angularJS 获取此表中每一行的索引
<table>
<tbody>
<tr ng-repeat = "cust in costomers">
<td> cust.name </td>
<td> cust.phone </td>
<td> cust.address </td>
</tr>
</tbody>
我想要一个包含每一行索引的变量,而不只是显示它
最佳答案
你可以使用 $index
<tr ng-repeat = "cust in costomers">
<td> {{$index}} </td>
</tr>
关于javascript - 使用angularJS获取表中行的索引,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24981322/