How can we append string to src content.
<img [src] = "data.imagePath"+".jpg">
I know its wrong.
But in angular version 1 we could achieve this
<img ng-src="{{data.imagePath}}.jpg">
My json is providing only the name of picture without extension. So how could I achieve this in angular 4.
Like this :
<img src = "{{data.imagePath}}.jpg">
or
<img [src] = "data.imagePath+'.jpg'">
This
<img [src]="data.imagePath + '.jpg'" />
should work.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With