Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AngularJS dynamic image sources

<img src="{{ twt.display }}"/>

I have the above image tag where the src is in the scope but when I look at the browser console log it shows the following

Resource interpreted as Image but transferred with MIME type text/html: "http://example.com/%7B%7Btwt.display%7D%7D".

The images do show as intended but I wanted to know if there was a way of stopping this message appearing?

like image 595
ngplayground Avatar asked Jul 06 '14 01:07

ngplayground


People also ask

Which is best angular or JavaScript?

As compared to JavaScript, AngularJS needs more time to do the same thing. JavaScript is one of the most effective web development techniques used for creating web applications. On the other hand, AngularJS has mostly been used as a JS framework for developing web applications.

Why we use angular instead of JavaScript?

AngularJS empowers developers to build rich internet applications (RIAs) more easily. Where many JavaScript frameworks focus on expanding the capabilities of JavaScript itself, AngularJS instead provides methods for enhancing HTML. AngularJS expands the capabilities of HTML beyond being a simple markup language.

Is angular written in Java?

Angular is an open-source, JavaScript framework written in TypeScript. Google maintains it, and its primary purpose is to develop single-page applications.

Why angular is used in Java?

Angular JS is an open source JavaScript framework that is used to build web applications. It can be freely used, changed and shared by anyone. Angular Js is developed by Google. It is an excellent framework for building single phase applications and line of business applications.


1 Answers

Use ng-src to avoid strange undeliverable requests being made by browser.

Once the expression in ng-src is resolved, it will update the src for the tag,

<img ng-src="{{twt.display}}"/>
like image 164
charlietfl Avatar answered Sep 27 '22 21:09

charlietfl