Load an image from URL


#1

Hello people. I want i load an image in img tag but the problem is that the URL is string that i get by http in JSON. My question is how can i set this string to the img attr “src”?


#2

Same way you bind any other attribute.

<img [src]="imgurl">

Then whatever you assign to the imgurl property of the controller becomes the image source.


#3

It work! I never thought it was so simple as that. Thanks man for answer.