I have an array with this form
$vars[1][1]["name"] = "John";
$vars[1][1]["lastname"] = "Doe";
$vars[1][2]["name"] = "Ely";
$vars[1][2]["lastname"] = "Tim";
$vars[2][1]["name"] = "Brad";
$vars[2][1]["lastname"] = "Vinnie";
$vars[2][2]["name"] = "Angelina";
$vars[2][2]["lastname"] = "Van";
.....
$vars[10][1]["name"] = "Ela";
$vars[10][1]["lastname"] = "Pearl";
$vars[10][2]["name"] = "Gustavo";
$vars[10][2]["lastname"] = "Tim";
which is in PHP. After that I send it to angularJS and i have
$scope.varArr = data.vars
after that in view I have
<div ng-repeat="(key, det) in varArr| orderBy: key">
{{det.name}} {{det.lastname}}
</div>
The problem is that it's not taking the array in the order 1,2,3...10
It's taking $vars[1] after that $vars[10] and after that $vars[2]. Instead of making the order after the number it's making after the string.
This situation is only if I have $vars[1][1] and $vars[1][2]...etc
If I would have only $vars[1][1], $vars[2][1], .... $vars[10][1] it will take the order after the number.