Quantcast
Channel: Ionic Forum - Latest topics
Viewing all articles
Browse latest Browse all 71232

Can't ngFor array of objects in *.component.html

$
0
0

Hi, I fetched below data from API and can’t ngFor product object, It gives NG0303: Can't bind to 'ngForOf' since it isn't a known property of 'ion-row' Error.

API Data:

{
    "id": "5175",
    "price": "4.50",
    "date": "2022-04-01 17:25",
    "product": [
        {
            "id": "95c8-73",
            "name": "Product Name",
            "edinica_id": "eb27549a073c",
            "izmerenija": {
                "id": "95-a03c",
                "naimenovanie": "pc"
            },
            "edinicy_izmerenij": [
                {
                    "id": "95d-e23c",
                    "name": "pc"
                }
            ]
        }
    ]
}

My *.component.html file.

 <ion-row *ngFor="let item of data.product">
          <ion-col>
            <p>ID:</p>
            <p>Name:</p>
          </ion-col>
          <ion-col>
            <span>
              {{item.id}}
            </span>
            <span>
               {{item.name}}
            </span>
          </ion-col>
</ion-row>

Thanks in advance.

2 posts - 2 participants

Read full topic


Viewing all articles
Browse latest Browse all 71232

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>