I'm pushing two times different data in my array :
$scope.numtickets.push({nbuser:data.users[i].name});
so i retrieve data in my view by doing this :
<ul ng-repeat="user in numtickets track by $index">
<li>{{user.nbuser}}</li>
<li>{{user.nbticket}}</li>
</ul>
and few lines after:
$scope.numtickets.push({nbticket:data.tickets.length});
and this display me this:
and what i want is to alternate the name and my number. so i should have : Claire pagniez 1 Michel Polnaref 1 Mathilde zimmer 3
and here is what my array display in my console:
If you see my all code, you can see that i have no choice to push first all names and then all my ticketnumber. So i need to sort elements by alternate name and ticket. So here is my all code from my controller:
$scope.displayuser = function(id) {
var token = "xxxxxxxx";
userdisplay
.send(token, id)
.then(function(data) {
console.log(data);
$scope.userbyorga = data.users;
$scope.numtickets = [];
for (i = 0; i < data.users.length; i++) {
var userid = data.users;
$scope.numtickets.push({
nbuser: data.users[i].name
});
var userarray = JSON.stringify(userid);
localStorage.setItem("myid", userarray);
}
})
.then(function() {
var tabuser = JSON.parse(localStorage.getItem("myid"));
var urls = [];
for (i = 0; i < tabuser.length; i++) {
urls.push({
url: JSON.stringify("https://cubber.zendesk.com/api/v2/users/" + tabuser[i].id + "/tickets/requested.json")
});
displayfilter
.user(token, tabuser[i].id)
.then(function(data) {
$scope.numtickets.push({
nbticket: data.tickets.length
});
});
}
});
}


data.users[i].nameat the end of my last request ?