How to iterate array inside array in ionic3?


#1

I am trying to get a list of products and I’m running into an issue due to the fact that it’s an array and inside array multiple array is used how to iterate array inside the object i have tried but show object object in html tell m anyone how to iterate array?

<ion-list style=" margin-top: 48px;">
  <ion-card *ngFor="let userProduct of sellerProductListViaCategory">
    <ul class='imageList'>
      <span *ngFor="let productSet of userProduct.sellerProductSetDto">
         <li *ngFor="let imageURL of productSet.setImageURLList">
          <img src="{{imageURL}}">
        </li> 
        <ion-icon ios="ios-close-circle" md="md-close-circle"></ion-icon>
      </span>
    </ul>
  </ion-card>
</ion-list>

#2

That’s not proper HTML. You cannot put block-level elements (like <li>) inside a <span>.


#3

I am showing [object-object] in html?


#4

@RomnEmpire I often see [object Object] when it’s an Observable, is that the case? If so you can use the async pipe or subscribe inside the component.


#5

sir tell m how to use async pipe indside the component?


#6

This tutorial might help: https://toddmotto.com/angular-ngif-async-pipe