javascript - Not retrieve image from JSON in Mobile Angular Ui.(Angular Js) -


i want retrieve image json. right retrieving these things json price, display order image can't retrieve.

html:

<div ng-controller="chooseproductdescription">                 <div ng-repeat="cat in productdescription">                         <img src="{{cat.product.productpictures[0].pictureurl}}">                         <span>price</span>{{cat.product.price}}                         <span>display order</span>{{cat.product.productpictures[0].displayorder}}                 </div>             </div> 

controller:

.controller('chooseproductdescription', function($scope, $http){     $http({         method:'get',         url:'http://www.json-generator.com/api/json/get/cgrvadfrgw?indent=2',         header:{'content-type':'application/json'},     }).success(function(data,status,headers, config){            $scope.productdescription = data;         alert("shjkshjksadhkjas");     }).error(function(data, status,headers, config){      }) }) 

right retrieving data url:

http://www.json-generator.com/api/json/get/cgrvadfrgw?indent=2

i want retrieve image json. please share ideas.

you not using correct format in reponse of $http promise. code should :

$http({     method:'get',     url:'http://www.json-generator.com/api/json/get/cgrvadfrgw?indent=2',     header:{'content-type':'application/json'}, }).success(function(response){        $scope.productdescription = response.data;     alert("shjkshjksadhkjas"); }).error(function(response){  }) 

Comments

Popular posts from this blog

javascript - jQuery: Add class depending on URL in the best way -

caching - How to check if a url path exists in the service worker cache -

Redirect to a HTTPS version using .htaccess -