angularjs - How to pass $index as a object key in ng-repeat? -
i facing problem angular have dynamic generated object in form below
object:{ 0: [], 1: [] }
this set in angular controller in html side want this
<tr ng-repeat="comapny in companies"> <td ng-repeat="option in object.$index">{{option.name}}</td> </tr>
$index comes tr
ng-repeat wraps ng-repeat $index variable.
is possible?
if have object can access array
option in object[$parent.$index]
you need use $parent.$index
because want access $index
of first ng-repeat
.
Comments
Post a Comment