AngualrJs ng-repeat使用 $parent.$index
当时用ng-repeat的时候在其子原属中可以使用$parent.$index获取父级下标,当没有没有多一级的ng-if,一般上级就是$parent.$index
angularJs
Variable Type Details
$index | number | iterator offset of the repeated element (0..length-1) |
$first | boolean | true if the repeated element is first in the iterator. |
$middle | boolean | true if the repeated element is between the first and last in the iterator. |
$last | boolean | true if the repeated element is last in the iterator. |
$even | boolean | true if the iterator position $index is even (otherwise false). |
$odd | boolean | true if the iterator position $index is odd (otherwise false). |