I’m trying to load an image from a JSON file into my ionic application.
I can load messages/strings from the JSON file but can’t get images to work.
Here’s my JSON file: http://wikicode.co.uk/file.json
acc
I’m trying to load ‘source’ link but it isn’t working.
Here’s my code:
HTML:
<img class="full-image" src="{{item.source}}">
Javscript:
.controller('announcementCtrl', function($scope, $http) {
$scope.data = [];
$scope.infiniteLimit = 1;
$scope.doRefresh = function() {
$http.get('http://wikicode.co.uk/file.json')
.success(function(data) {
$scope.data = data;
$scope.$broadcast('scroll.refreshComplete');
})
.error(function() {
$scope.data = [];
$scope.$broadcast('scroll.refreshComplete');
});
}