Reputation: 785
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:
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?
Upvotes: 0
Views: 263
Reputation: 2105
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!
Upvotes: 1
Reputation: 4176
(Perhaps I should have put this in a comment; totally going to get flamed)
I wonder if it could be a z-index issue?
Upvotes: 0