Reputation: 449
i get several json array and i want to retrieve some data in a loop. what i want is the value of the key count
Here is my code :
.then(function(){
var tabuser = JSON.parse(localStorage.getItem("myid"));
for(i = 0; i < tabuser.length; i++){
console.log(tabuser[i].id);
displayfilter
.user(token,tabuser[i].id)
.then(function(data){
console.log(data);
$scope.numtickets = data;
})
}
})
Here what i get from my `console.log(data):
And i want to retrieve the value of the key count
for every json array. How can i display that in my view ?
Upvotes: 0
Views: 198
Reputation: 70
Create a json array:
$scope.numtickets = [];
Keep pushing the value of the keycount:
$scope.numtickets.push(data);
Display the array on the view:
<div ng-repeat="numticket in numtickets">
{{numticket.count}}
</div>
Upvotes: 1