我在ng-repeat中有一个ng-repeat,内部ng-repeat内有ng-include。在ng-include中,我想用$ parent访问外部ng-repeat。这是我的示例代码:
的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”解析为此)
<div> Your population id is {{ $parent.$index }}</div>
我无法从$parent.$index
访问ng-include
。