This is the pic of console.log for the received json.

Can anyone please tell how to iterate over this i am not able to iterate.
currently i am using this code to iterate but this is not working.
home.html
<div *ngFor="let item of allItems">
<p> {{item.Item.ASIN}} </p>
</div>
home.ts
public allItems:any[]=[];
public test:any;
constructor(public navCtrl: NavController, public http:Http ,public navParams: NavParams) {
this.http.get('http://localhost/bar/dev/item_search.php?keyword=new')
.subscribe(res => {this.allItems = res.json(); console.log(this.allItems);
});
}
Thanks in advance…
Please post the result of JSON.stringify(this.allItems)
(as text, not as an image).
Sorry, but I need the whole thing or else it’s not properly formatted JSON and I can’t use my IDE to format it. Use pastebin or something if you wish.
Sorry just edited it…a bit thing changed in the data received
Got it.
<div *ngFor="let item of allItems.Item">
<p>{{item.ASIN}}</p>
</div>
Still not working…
can you suggest anything else
Works for me. I copied that entire pastebin into this.allItems
, used that template, and got the following:
B014DYVWWS
B01LY4V6IM
B06Y3JH7TN
B06Y3HFZBQ
B01618MY62
B01J14O7ZY
B01LZ4XMEX
B01DDP7D6W
B0161959NQ
B06XYL2NHB
can you paste your .ts code here…
allItems = {/*your entire pastebin*/};
1 Like
Naturally, if you’re getting this from a future, you need to seed allItems
initially with something so the ngFor
doesn’t choke, like:
allItems = {Item: []};
Just changed allItems:any[]=[]; to allitems:any={};
All thanks to you…Thanks a lot…
You are always a great help 
Please take the time to define proper interfaces instead of using any
. It really is worth the effort. Your code will be much more readable and you will protect against typos.