2 pièce(s) jointe(s)
Parcourir un tableau multidimensionnel
Bonjour,
Je développe une application mobile avec IONIC/ANGULAR, depuis plusieurs je cherche désespérément une solution a mon problème.
j'interroge une API qui m'envoie des données (voir image jointe)
Pièce jointe 595617
jarrive a afficher dans un tableau(dans ma pag html) a afficher certains élements; mais je n'arrive pas a afficher TAG_ID( comme le montre l'image)
voici mon code html:
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
| <ion-row *ngFor="let payLoad of PayloadData">
<div *ngIf= "payLoad.STATUS !== '4'">
<ion-col >
{{payLoad.SUBS_ID}}
</ion-col>
<ion-col>
{{payLoad.SOLDE }} FCFA
</ion-col>
</div>
// c'est ici mon problème
<div ngIf="payLoad.TAGS.STATUS === '1'">
<ion-col>
{{payLoad.TAGS.TAG_ID}}
</ion-col>
</div>
</ion-row> |
Voici mon code TypeScript:
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
| getHistorique() {
let url = "xxxxxxxxxxxx" + this.elmt.PAYLOAD.IDENTITY;
this.http.get(url)
.subscribe(
async (res: any[]) =>
{
this.idty = res;
//Avec cette variable je reussi a afficher le num abonné {{payLoad.SUBS_ID}} et le solde {{payLoad.SOLDE }} FCFA
this.PayloadData = this.idty.PAYLOAD;
//c'estiici je n'arrive pas a entré dans TAGS pour recuperer TAG_ID
this.ok = this.PayloadData.TAGS;
console.log(this.ok);
},
async (err: any[]) => {
console.log(err);
});
} |
Pièce jointe 595616
Je vous remercie d'avance