我們需要敏感的數據添加到數組,然後我們需要在html.We到dispaly試過這樣添加對象數組中的for循環angularjs
var RequestAs = [];
for (var i = 0; i < RequestLength; i++)
{
$http({
method: "GET",
url: "http://183.82.0.221:2244/api/PostPets/GetCustomerDetails?ID=" + results.rows.item(i).PosterId + ""
}).then(function mySucces(response) {
var RequestA = response.data;
$scope.RequestAs.push(RequestA);
}, function myError(response) {
alert(response);
//console.log('ERR'+response.message);
});
}
我們試圖在HTML這樣
<div class="list" ng-hide="registered" ng-repeat="Reques in RequestAs">
<div class="item tabs tabs-secondary tabs-icon-left">
<a class="tab-item" href="#">
<i class="icon ion-person"></i>
{{Reques.CustName}}
</a>
</div>
<div class="item item-text-wrap">
{{Reques.Address}}
</div>
</div>
我們得到這樣 第一循環的數據
[
{
"CustName": "Pavan",
"Address": "Hyd",
}
]
二
[
{
"CustName": "Naveen",
"Address": "Eluru",
}
]
請指導我們。我的code.What worng在我們的最後一天stugglied。
請告訴我預期的結果? –
@AdityaSingh謝謝你的回覆。我們需要在Html中同時顯示兩個數組數據。請指導我們 –
嘗試建議的答案,如果有任何問題,然後評論它 –