how to bind img src in angular 2 in ngFor?

前端 未结 4 1643
感动是毒
感动是毒 2020-12-01 09:18

In my project I am getting data: image src, student name and student id. I bind student name and student id.

How to bind

4条回答
  •  猫巷女王i
    2020-12-01 09:39

    Angular 2, 4 and Angular 5 compatible!

    You have provided so few details, so I'll try to answer your question without them.

    You can use Interpolation:

    
    

    Or you can use a template expression:

    
    

    In a ngFor loop it might look like this:

提交回复
热议问题