AngularJs Change Image Src URL : Sometimes we need to change the image source in angularjs. There are many ways to change the Image source in AngularJs. Here in this tutorial we are going to explain how you can change the image source in AngularJs. You can use our online editor to edit & run the code online.
AngularJs Change Image Src URL Example
You can change the image url simply as below –
AngularJs Change Image Src URL Example:
<div ng-app="myApp"> <div ng-controller="myController"> <button ng-click="changeUrl('http:://example.com/images/logo.png')">Change Url</button> <br/> <amp-img src="{{imageUrl}}" width="600" height="400" class="amp-wp-unknown-size amp-wp-enforced-sizes" sizes="(min-width: 600px) 600px, 100vw"></amp-img> </div> </div> |
If you click on the change url button it will change the image source url with new url passed in the function method.