@NthabyMogoboya wrote:
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 allowedservice.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’}}
Posts: 5
Participants: 2