0

I am working on an Ionic project and via json I was able to readout my data in the view. But for some reason my image won't come through.

Here is a screenshot of my console:

enter image description here

As you can see from the picture the data is coming in correctly.

My html code:

  <ion-list>
      <div ng-repeat="newsItem in newsItems">
        <a href="#">
            <img ng-src="{{newsItem.picture}}" width="80" height="80">
            <p>{{newsItem.name}}</p>
        </a>        
      </div>
  </ion-list>

Anyone has an idea why the image is not showing?

GY22
  • 755
  • 2
  • 17
  • 48

2 Answers2

1

ok, first you jsfiddle is broken ! but no biggie, just remove ';' from the first line. Second your json news doesn't have a pictures it's just this ...

{"newsID":"58","name":"Chemicar presentation","idk":"new","kind":"news","picture":"58.jpg","picture1":"","start_time":"1446073201"}

You are binding to {{newsItem.picture}} and as you can see your picture it's there as a 58.jpg but this is not a picture it's just a string of picture name, so that's why it's not showing anything in the html!

macrog
  • 2,085
  • 1
  • 22
  • 30
0

(Perhaps I should have put this in a comment; totally going to get flamed)

I wonder if it could be a z-index issue?

Pytth
  • 4,008
  • 24
  • 29