Avoiding 404 Errors Of IMG Tag URL In Angular JS Before Loading

While this is not a show stopper in any Angular JS Single Page Application, developers will never like it seeing any errors in the Javascript console.

When assigning dynamic URLs in IMG tags in Angular JS, the IMG tag tends to load the URL even before the variable is assigned, hence the 404 errors.

To avoid this scenario, simple change the SRC attribute of your IMG tag and use ng-src. That should fix it.

Related Posts Plugin for WordPress, Blogger...

Leave a Reply

Your email address will not be published. Required fields are marked *