I have often done a nested ng-repeat to loop through child data when I have json such as
[
{ "accountnum": 1,
"name": "foo",
"subacct": [
{ "accountnum": 1-1,
"name": "bar"
} ...
]
} ...
]
And then I use this pattern:
<tr ng-repeat-start="a in cac.costAccounts">
<td>{{a.first_name}} {{a.last_name}}</td>
<td>{{a.account_number}}</td>
<td>{{a.description}}</td>
</tr>
<tr ng-repeat-end ng-repeat-start="sa in a.subacct">
<td>{{sa.first_name}} {{sa.last_name}}</td>
<td>{{sa.account_number}}</td>
<td>{{sa.description}}</td>
</tr>
This works. But THIS time the data includes a third level; the subacct objects have a key of subsubacct.
[
{ "accountnum": 1,
"name": "foo",
"subacct": [
{ "accountnum": 1-1,
"name": "bar",
"subsubacct": [
{ "accountnum": 1-1-1,
"name": "bar"
} ...
} ...
]
} ...
]
So I tried adding a third level, but it does not show up (no console errors):
<tr ng-repeat-start="a in cac.costAccounts">
<td>{{a.first_name}} {{a.last_name}}</td>
<td>{{a.account_number}}</td>
<td>{{a.description}}</td>
</tr>
<tr ng-repeat-end ng-repeat-start="sa in a.subacct">
<td>{{sa.first_name}} {{sa.last_name}}</td>
<td>{{sa.account_number}}</td>
<td>{{sa.description}}</td>
</tr>
<tr ng-repeat-end ng-repeat="ssa in sa.subsubacct">
<td>{{ssa.first_name}} {{ssa.last_name}}</td>
<td>{{ssa.account_number}}</td>
<td>{{ssa.description}}</td>
</tr>
So how do I get the third loop?