How can we append string to src content.
<img [src] = "data.imagePath"+".jpg">
Run Code Online (Sandbox Code Playgroud)
I know its wrong.
But in angular version 1 we could achieve this
<img ng-src="{{data.imagePath}}.jpg">
Run Code Online (Sandbox Code Playgroud)
My json is providing only the name of picture without extension. So how could I achieve this in angular 4.
Viv*_*shi 12
Like this :
<img src = "{{data.imagePath}}.jpg">
Run Code Online (Sandbox Code Playgroud)
or
<img [src] = "data.imagePath+'.jpg'">
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
7269 次 |
| 最近记录: |