I have the following set of data coming from a JSON file which I am trying to display via "*ngFor" in my template. I can display most of it except the "people" Objects. There can be any amount of "people" Objects. This example data set only has 2 in it.
[{
"caseNumber": "01/01/2020",
"caseData": {
"caseType": "Criminal",
"caseCompName": "",
"caseCompNumber": "12121212",
"caseDate": "01/02/2019",
"caseTime": "12:00",
"caseStatus": "Open"
},
"people": [{
"name": "Paul",
"lastName": "Von Zeuner",
"middleName": "Waldemar",
"dob": "1981-09-29",
"countryBirth": "South Africa"
},{
"name": "John",
"lastName": "Doe",
"middleName": "Steve",
"dob": "1981-09-29",
"countryBirth": "South Africa"
}]
}]
I attempted something like this but it only displays the first person. Im not sure if the Array itself is incorrectly structured or if the *ngFor is the problem
<div *ngFor='let item of caseData; let i=index'>
<div class="row">
<div class="col-sm">
Name: {{item.people[i].name}}
</div>
<div class="col-sm">
Last Name: {{item.people[i].lastName}}
</div>
</div>
<div class="row">
<div class="col-sm">
Middel Name: {{item.people[i].middleName}}
</div>
<div class="col-sm">
Country of Birth: {{item.people[i].countryBirth}}
</div>
</div>
</div>
Please assist me