如何在现有的NgFor循环中执行ngFor?

时间:2016-10-27 00:15:47

标签: angular

我有一个Ng For循环,需要另一个内部ngFor循环来抓取每个用户的照片,但它没有显示在我的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>

如何正确使用ngFor?其余的html显示正常

1 个答案:

答案 0 :(得分:3)

src没有绑定,它设置为文字。像这样绑定它:

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