Hi
I’m working on a project and I need to handle an array of dictionaries and show them on the screen , I was able to get the data from the API and print them in the console but I couldn’t handle them !
here is an example of a response :
[{"title":"test","desc":"testing","image_path":"uploads/8 (1).jpg58f214dcd4787.jpg"},{"title":"Bxbx","desc":"Bxbxbx","image_path":"uploads/image58f214e9a90a4.jpg"},{"title":"Bdbxb","desc":"Bdbxb","image_path":"uploads/image58f246021a065.jpg"}]
and here is the code of the html component :
<ion-list>
<ion-list-header>Menue</ion-list-header>
<ion-item *ngFor="let it of menu">
<ion-thumbnail item-left>
<img src="url_to_api/"+{{it.image_path}}>
</ion-thumbnail>
<h2>{{it.title}}</h2>
<p>{{it.desc}}</p>
</ion-item>
</ion-list>
note : the array which hold the data is called : menu in the .ts file