Issue
How to display image in angular?
<div><img class="images" ng-src="{{./resources/img/new.png}}"/></div>
<div><img class="images" src="./resources/img/new.png"/></div>```
Solution
Learn angular template binding (https://angular.io/guide/template-syntax). If you have image in local like (./resources/img/new.png) you can use normal html source tag
<img class="images" src="./resources/img/new.png"/>
Or your image comes from server or dynamically that time you have to bind that like
img = this.imageSource
<img class="images" src={{img}}/> or
<img class="images" [src]="img"/>
Answered By - Velusamy Venkatraman
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.