i'm trying load image http.get application. i'm unsure why picture isn't loading.
here code:
html:
<ion-view view-title="gallery" align-title="center" ng-controller="photoctrl"> <ion-content class="center" ng-init="getimages()"> <div class="item item-divider"> <i class="ion-images"></i> under6/7/8/9s photos </div> <a class="item item-list-detail"> <ion-scroll direction="x"> <img on-hold="onhold()" ng-repeat="image in images" ng-src="images" ng-click="showimages($index)" class="image-list-thumb" /> </ion-scroll> </a> </ion-content> </ion-view> javascript:
.controller("photoctrl", function($scope, $http) { $scope.data = []; $scope.getimages = function() { $http.get('https://api.myjson.com/bins/1jovy') .success(function(data) { $scope.data = data; }) } });
add photoctrl controller view
i saw ng-repeat="data in data", here item , collection having same name, not practice....
if rewiting ng-repeat="img in data" ng-src like
ng-src="{{img}}" updated codepen
Comments
Post a Comment