I have a ng-repeat inside a ng-repeat with a ng-include inside of the inner ng-repeat. Inside that ng-include, I want to access the outer ng-repeat with $parent. Here is my sample code:
index.html
<div ng-repeat="population in populations">
<div ng-repeat="person in population">
<div ng-include="person.url"></div>
</div>
</div>
one_person.html ("person.url" resolves to this)
<div> Your population id is {{ $parent.$index }}</div>
I am not able to access $parent.$index
from that ng-include
.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.