AngularJS ng-src Directive
The AngularJS ng-src directive is used to solve the problem where original src attribute doesn't work properly. So AngularJS ng-src directive is used and it overrides the original src attribute of an <img> element.
The ng-src directive should be used instead of src when you have AngularJS code inside the src value. It ensures that the image is not displayed wrong before AnglarJS code is executed.
The wrong way to write this:
The right way to write this:
string: It specifies a string value, or an expression resulting in a string.
Let's take an example to demonstrate the usage of ng-src directive.
See this example:Test it Now