Reputation: 13
I am trying to loop over an array but change a parent reference each time. I guess my explanation isn't very good so here is my code with comments on what i want to happen
<div class="row" data-ng-repeat="number in numbers">
<!--number = 001 to 054-->
<div class="col-xs-8 text-center">
<div data-ng-repeat="item in properties | limitTo: 1">
<h5 class="text-capitalize">{{item.jobs.001.jobDisplay}}</h5> <!--get 001 to = number-->
<!--Something like {{item.jobs.{{number}}.jobDisplay}}-->
</div>
</div>
</div>
Thanks
Upvotes: 1
Views: 121
Reputation: 44906
You can reference them via bracket notation:
<h5 class="text-capitalize">{{item.jobs[number].jobDisplay}}</h5>
Upvotes: 1