在Angular中,ng-repeat指令是否可以跳过级别?
例如,在这样的嵌套数组上:
{ id: 1, name: "A",
children : [
{id: 11, name: "AA",},
{id: 12, name: "AB",
children : [
{id: 121, name : "ABCA",
children : [
{id: 1211, name : "ABCAA"}
]}
]}
]}
我知道表示级别3或4的唯一方法是迭代早期级别,如:
<div class="level1" ng-repeat="level in levels">
{{level.name}}
<div class="level2" ng-repeat="level in level.children">
{{level.name}}
<div class="level3" ng-repeat="level in level.children">
{{level.name}}
<div class="level4" ng-repeat="level in level.children">
{{level.name}}
</div>
</div>
</div>
</div>
是否可以跳过x级别,并使用指令直接跳转到所需的级别?
如果有任何帮助,可以在此处找到上述内容:https://jsfiddle.net/gowkgv4q/
感谢。