我對angularjs完全陌生,在這裏我試圖做的是從ng-repeat獲取一個img id,並通過函數傳遞它並獲取返回的圖像字符串,但它顯示了一些錯誤。請幫忙。ng-src in ng-repeat not updating
HTML
<tr data-ng-repeat="(key, list) in listOfProperties">
<img ng-src="{{getImageUrl(key)}}">
</tr>
JS
$scope.getImageUrl=function(key){
return factory.getImgUrl(key).then(function(data){
return data
});
}
廠
getImgUrl:function(key){
return $http({
method:"GET",
url:somedomain.com/getCoverPicture",
//This domain will return a image string.
params:{'key':key}
}).then(function(response){
return response.data;
})
}
u能PLS下面添加 – byteC0de
錯誤這是我收到angular.min.js:118錯誤:[$ rootScope:infdig] http://errors.angularjs.org/1.5.8/ $ rootScope/infdig?p0 = 10&p1 =%5B%5D –