I'm using Angular and trying to create nested ng-repeats. I've referred to the ng-repeat examples on the Angular site here here. But when I use the code below, the <ul> tag repeats but the <li> tag is blank. Any suggestions on how to do this correctly?
(EDIT: Updated array to address comment)
Array:
vm.projects = [
{"$id": "1234",
"people": {
"-K-v76MWDTIQqnR2w10r": {
"name": "John Doe",
"city": "New York",
"company": "Acme, Inc."
},
"-K-q7HmGUduAf5JkSGDY": {
"name": "Jane Smith",
"city": "Chicago",
"company": "ABC, Inc."
}
}
},
{
"$id": "2345",
"people": {
"-K-qq6Pcd0v1wggmALcZ": {
"name": "David Jones",
"city": "London",
"company": "Stardust, LLC"
}
}
}
]
HTML
<ul ng-repeat="project in vm.projects" >ID: {{project.$id}}
<li ng-repeat="name in vm.projects.people.name track by projects.$id">{{project.person.name}}
</li>
</ul>
Here is what actually displays:
ID: 1234
ID: 2345
<li>tags but still no content.