Load an image from URL

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”?

1 Like

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 Likes

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