0

I make a simple demo in angular js to call service .Actually I am not able to display my image in my list . First check my web service url

on desktop : --disable -websecurity

  • I am able to call service but my image is not display on list here is my 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>
1
  • what is the URL of image that you are trying, is it from same domain or from different domain? Commented Jun 20, 2015 at 6:14

2 Answers 2

2

Use ng-src:

Using Angular markup like {{hash}} in a src attribute doesn't work right: The browser will fetch from the URL with the literal text {{hash}} until Angular replaces the expression inside {{hash}}. The ngSrc directive solves this problem.

<img ng-src={{d.image.Thumb}}>
//   ^^^
Sign up to request clarification or add additional context in comments.

7 Comments

Docs :- docs.angularjs.org/api/ng/directive/ngSrc. Kudos !!. You beat me by 20 sec :P. I deleted my anser :P
still no image display usng your solution
actually I display my security of chorme .first you disable the web sercuity then check
use this --disable-web-security in chrome property
|
0

Replace with this

                   <img ng-src="d.image.Thumb">

2 Comments

This is wrong. Text must be placed in double braces like {{d.image.Thumb}}
No need of double curly braces if ur using 'ng-src'

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.