html - How to store an image url received from server to variable in angular js and ionic -


i trying image url response object , store in variable here code getting image url server

$http.post("http://aflaree.com/apmsservice/securityservice.svc/availablefacility",loginid)       .success(function(response){         console.log(response);         console.log(response.facility);         console.log(response.facilityimage);         $scope.img = response.facilityimage;         console.log($scope.img);                 })       .error(function(response){         console.log(response);       });   

here response above post method.

here html planing display image

<div >     <img ng-src="{{img}}"> </div> 

issues

i able store or view log field response except facilityimage field.

some how if able store image $scope.img using 2 way data binding able show image in html page

if there other way make access of image url form facilityimage please let me know how show image view.

facilityimage attribute of facility, therefore have access this:

response.facility.facilityimage 

hope helps!

update: event level deeper, facility array multiple facilities, assuming pick first one:

response.facility[0].facilityimage 

Popular posts from this blog

php - How should I create my API for mobile applications (Needs Authentication) -

5 Reasons to Blog Anonymously (and 5 Reasons Not To)

Google AdWords and AdSense - A Dynamic Small Business Marketing Duo