I have an object which keys are years:
years: {
"2100": {
countingAgent: false,
turns: 3,
cards: 4,
score: 3
},
"2000": {
countingAgent: false,
turns: 4,
cards: 3,
score: 4
},
"1900": {
countingAgent: false,
turns: 5,
cards: 2,
score: 6
} ...
}
I want the higher years to be first, I have this ng-repeat
:
<li class="year" ng-repeat="(year, data) in years">
I tried | orderBy:'year':true"
and | orderBy:'score':true"
but none worked, it always puts 1900 first.
---UPDATE---
It seems all solution resolve around creating a filter converting object to array. Is there no solution that is more elegant?