I have extracted Json data from a mongodb database collection.
Successfully displayed the keys of this json.
Currently attempting to present an array in a table using a double ng-repeat in my view.
Although I am close to achieving my desired outcome, the order of values is incorrect.
Using the attribute names of my items yields the correct result, but that is not the preferred solution for me.
Here is the code snippet used in my view:
<table class="table table-striped">
<caption>Content</caption>
<thead>
<tr>
<th ng-repeat="caption in captions">
{{caption}}
</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="content in contentCollection">
<td ng-repeat="item in content">
{{item}}
</td>
</tr>
</tbody>
</table>
This currently displays:
_id session expires
id1 expires1 session1
However, it should show as:
_id session expires
id1 session1 expires1
The controller sends an array with the correct value order (id1, session1, expires1), which I can confirm in the Chrome console using console.log()
.
I believe creating a directive might provide a workaround, unless I overlooked something.
Any insights on what could be causing this issue?
Thank you,
Rom