From the database, I am receiving a JSON object which is one large object:
$scope.totalsum =
{
"A1": 1155000,
"A2": null,
"A3": 2133,
"A31": 29292,
"A32": 2321,
"A33": 232342,
etc....
},
I want to display A31 & A32 in a collapsed table data row. The ng-repeat for the object looks like this at the moment:
<tr ng-repeat-start="data in totalsum" ng-click="isRowCollapsed=!isRowCollapsed">
<td>
<input class="form-control" placeholder="{{data.total | number:2}}">
</td>
</tr>
<tr ng-repeat-end ng-show="data.breakdown.length>0" ng-hide="isRowCollapsed">
<td ng-show="data.breakdown.length>0">
<div class="subvalues" ng-repeat="subvalues in data.breakdown">
<input class="form-control" placeholder="{{subvalues.subtotal | number:2}}">
</div>
</td>
</tr>
<tr>
<td>
<input class="form-control" placeholder="{{getTotal('total') | number:2}}">
</td>
</tr>
Initially, my working ng-repeat was for a JSON object structured like this:
$scope.totalsum = [
{
"total": 1155000,
"breakdown": null
},
{
"total": 233235000,
"breakdown": [
{
"subtotal": 22002020
},
{
"subtotal": 22002020
}
]
},