I get this error when i try to display in my html file.
Error: Error trying to diff ‘[object Object]’. Only arrays and iterables are allowed
service.ts
private _addProduct = “http://localhost:4000/viewMenu”;
getItems(){
return this.httpClient.get(this._addProduct);
}
page.ts
menuList = ;
ngOnInit() {
this.cartService.getItems().subscribe(data => {
console.log(data);
this.menuList = data;
console.log(this.menuList);
});
page.html
<ion-card *ngFor=“let p of menuList”>
{{p.item_name}}
{{p.item_price | currency:‘R’}}