After retrieving an array of objects using the code snippet below:
this.serviceOne.getRemoteData().subscribe(
data => this.MyArray.push(data)
);
I encounter issues when trying to iterate through the array using the code snippet below:
<ion-card *ngFor="let ma of MyArray; let i=index">
<p>{{ma.stuff}}</p>
</ion-card>
The iteration works fine with a single object in the array, but fails with multiple objects. I believe I need to use a foreach loop to process each object individually, but I'm not familiar with TypeScript syntax.
Thank you for your assistance!
Console.log output (in string):
[{
"id_oiseau":1,
"nom_commun":"Hirondelle",
"lieu_signalement":"Foret",
"date_signalement":"2017-05-16",
"condition_signalement":"Aile coincee sous branche",
"date_reception":"2017-05-16",
"date_renvoi":"2017-05-02",
"descriptif_etat":"Aile cassee",
"immatriculation":"EZ654ERRZ",
"etat_actuel":"En attente de livraison",
"image":"bird-profil.jpg",
"id_oiseau_dico":1,
"id_adherent_lpo":1,
"id_acteur":1,
"pays":"France",
"nom_codifie":"HIRON-NANT-4949845",
"id_statut_oiseau":1,
"id_local_lpo":1},
{"id_oiseau":2,"nom_commun":"Moineau","lieu_signalement":"Sur la route","date_signalement":"2017-05-12","condition_signalement":"Sur le bas cote avec trace de sang","date_reception":"2017-05-03","date_renvoi":"2017-05-19","descriptif_etat":"Ne bouge plus sauf la tete","immatriculation":null,"etat_actuel":"Convalescence","image":"bird-1.jpg","id_oiseau_dico":2,"id_adherent_lpo":2,"id_acteur":2,"pays":"France","nom_codifie":"MOIN-ANG-4254545","id_statut_oiseau":2,"id_local_lpo":2}]