This questions is in relation to another question of mine; angularjs-multi-level-tables-inside-another-if-clicked. (You can see "full" JSON there.)
Why can't I have an ng-repeat like below?
<tbody>
<tr data-ng-repeat="dayData in storeDataModel.storedata[0].data">
<td>{{dayData.date}}</td>
<td>{{dayData.cost}}</td>
<td>{{dayData.sales}}</td>
<td>{{dayData.revenue}}</td>
<td>{{dayData.employees}}</td>
<td>{{dayData.employeeHoursSum}}</td>
</tr>
</tbody>
Angular finds the number of objects in the array "dayData" for this particlar "store" (the storedata[0] is the first store) but for some reason it creates n+1 rows instead of n and there's no data at all in any of the rows.
I have also tried a lot of combinations, trying to make it work...:
- storeDataModel.storedata.data -returns no rows at all
- storeDataModel.storedata.$index.data -returns no rows at all
- storeDataModel.storedata.$index+1.data -returns errors
- storeDataModel.storedata.$first.data -returns no rows at all
Is what I am trying to do possible at all or do I need to write a directive to get the specific store dayData information and put in a temporary model for that specific store and then do a ng-repeat on the temporary model?
(Also, as I am trying to get this particular table as content to a "fake accordion", i.e. when clicking a row in the parent table to expand/collapse and show this particular table (see my linked question) - are there any non-compatibilities if I include ng-clicked or own directive together with your proposed solution?)