deek
deek

Reputation: 1095

How to do ngFor within existing NgFor loop?

I have an Ng For loop and need another internal ngFor loop to grab every user photo inside but it's not showing up inside my html:

<sebm-google-map-marker *ngFor="let m of markers; let i = index"
   [latitude]="m.latitude" [iconUrl]="'app/images/' + m.sport + '.png'"
   [longitude]="m.longitude" [visible]="m.options.visible" id="i">

  <sebm-google-map-info-window>
    <strong><h5>{{m.title}} - {{m.date}}</h5>
    <p>Going: {{m.going}}, Maybe Going: {{m.maybeGoing}},
       Address: {{m.address}}, Group: {{m.title}}</p></strong>
    <span class="image-info-window">
      <img *ngFor=' let b of m.group.group_photo;' src='b.thumb_link'>
      <p>does it work?</p>
    </span>
  </sebm-google-map-info-window>

</sebm-google-map-marker>

How does one use ngFor within correctly? The rest of the html shows up fine

Upvotes: 0

Views: 240

Answers (1)

cartant
cartant

Reputation: 58400

src is not bound, it's set to a literal. Bind it like this:

<img *ngFor='let b of m.group.group_photo;' [src]='b.thumb_link'>

Upvotes: 3

Related Questions