I have an app where a call to my API returns an object that also contains an array of objects.
Essentially:
{
"_id": "587bc430e64e9f28a6894dd4",
"lastname": "Lane",
"firstname": "Panny",
"__v": 0,
"contacts": [
{
"name": "rick jevers",
"age": 25,
"_id": "587bc430e64e9f28a6894dd5"
}
]
},
I thought the way to display the objects in the array was to use another ng-repeat, like so:
<div class="col-md-12" style="clear:both; padding:30px;">
<ul style="list-style: none">
<li ng-repeat="item in sample.post">
<strong>
{{item.firstname}} {{item.lastname}}
</strong>
<ul style="list-style: none;">
<li ng-repeat="contact in sample.post.contacts">
{{contact.name}}
</li>
</ul>
</li>
</ul>
</div>
But this doesn't work for me.
What am I missing?