【发布时间】:2017-05-31 22:07:57
【问题描述】:
我正在尝试将产品图片带到另一个带有产品编号的表格
但是,产品被列出,而图像始终是数组中的最后一项
我的 Angular 控制器:
.controller('anasayfaCtrl', ['$scope', '$stateParams','$http',
function ($scope, $stateParams,$http) {
$scope.urunler=[];
$scope.urunGetir=function(){
$http.get("http://www.elli2.com/mobil/urunler").then(function(response){
$scope.urunler=response.data;
})
}
$scope.data=[];
$scope.gorsel=function(id){
$scope.data =$http({
method: 'GET',
url: 'http://www.elli2.com/mobil/urunGorsel/'+id
}).success(function(response){
return "url/"+response.urun_gorsel;
});
console.log($scope.data);
}
}])
我的 HTML:
<div ng-init="urunGetir()" >
<ion-item ng-repeat="urun in urunler" class="item-thumbnail-left positive" id="anasayfa-list-item5" href-inappbrowser="/urundetay">
<img ng-src="{{ urunGorsel }}" ng-init="gorsel(urun.urun_id)">
<h2positive>{{ urun.urun_adi }}
<p style="white-space:normal; font-weight: bold;">Fiyat: <span style="color:blue">{{ urun.urun_fiyati }} </span></p>
<ion-option-button class="button-positive"></ion-option-button>
</h2positive>
</ion-item>
</div>
我在等你的帮助
【问题讨论】:
-
ng-src ={{urunGorsel}}??? urunGorsel 在哪里?
标签: javascript angularjs ionic-framework