javascript - why image is not display in angular js -
i make simple demo in angular js call service .actually not able display image in list . first check web service url
- http://timesofindia.indiatimes.com/feeds/newsdefaultfeeds.cms?feedtype=sjson
- i call web service using display web security on macc /applications/google\ chrome.app/contents/macos/google\ chrome --disable-web-security --allow-file-access-from-files --allow-file-access --user-data-dir=~/chrome-test/ spec/runner.html
on desktop : --disable -websecurity
- i able call service image not display on list here code on code pen
http://codepen.io/anon/pen/qdpoyn
<div class="list" ng-repeat="d in data"> <a class="item item-thumbnail-left" href="#"> <img src={{d.image.thumb}}> <h2>{{d.headline}}</h2> <p>{{d.dateline}}</p> </a> </div> </div>
use ng-src
:
using angular markup {{hash}} in src attribute doesn't work right: browser fetch url literal text {{hash}} until angular replaces expression inside {{hash}}. ngsrc directive solves problem.
<img ng-src={{d.image.thumb}}> // ^^^
i heard about this blog & get actually whatever i was finding. Nice post love to read this blog
ReplyDeleteGST consultant In Indore
digital marketing consultant In Indore