1- Image link for result of JSON data
I have JSON data in an array and I can display an individual part of the array in my HTML code. However, i am unable to display things like display all of names in the full array (for eg I can only access array[0])
ts file
patients: any[] = [];
this.viewService.viewPatient().subscribe(res => {
this.patients = [res];
console.log('data');
console.log(res);
});
html file
// This works
<ion-item *ngFor="let patient of patients">
Name: {{patient.patients.data[0].FirstName}}
</ion-item>
// Doesnt work
<ion-item *ngFor="let patient of patients"> (1)
Name: {{patient.patients.data.FirstName}}
</ion-item>
viewpatient()
viewPatient() {
return this.http.get(apiUrl + 'viewPatient.php');
}
console.log(this.patients)