Angular 2 image src as function return

Discussão em 'Angular' iniciado por Nacim Idjakirene, Setembro 14, 2024.

  1. In my Angular 2 application I have a list of users "Users:any" which contain the properties: name, job, age... etc. The problem is that to get the profile image I have to get the the id of the image from the Users object, then use a web service getImage(ImageId), so I have this in my html:

    <div *ngfor="let user of users">
    <img [src]="getImage(user.profileImageId)"/>


    In this case, I can't get the profile image displayed, I think the html is loading before the data?

    Continue reading...

Compartilhe esta Página