我正在使用angularjs array
來存儲使用http.get rest API接收的record data(table rows)
,並使用ng-repeat進行打印。問題是每當只有一個記錄通過rest API檢索時,ng-repeat不會打印記錄。 ng-repeat僅在API檢索多個記錄時纔打印記錄。當角度數組有一條記錄時,角度數組不會顯示數據
$scope.details=[];
var lrequ = {
method: 'GET',
url: "https://example.com/execSQL?sql=mysqlquery",
headers: {
"Content-Type": "application/json"
}
}
$http(lrequ).then(function(response){
$scope.details=response.data.platform.record;
}, function(){alert("failure");});
這是我的NG-重複線,
<div class="col-lg-12" ng-repeat="dat in details | filter : { product_name : textname} as results">
問題是什麼?這個問題是NG重複或$ scope.details陣列?
請在你的問題 –
取下過濾提及您迴應並嘗試一次。 –
你已經把過濾器放在你的對象上,也許在過濾數據後沒有找到任何記錄。 –