The parameters to orderBy must match property names in an array of objects.
Your data needs to look something like this:
$scope.list2 = [ { id:"2013-01-08T00:00:00", name:'Joe'},
{ id:"2013-01-09T00:00:00", name:'Sue'}];
Then a filter like this will work:
<div ng-repeat="item in list2 | orderBy:'id':true">
Fiddle.
Note that orderBy works on the entire array (something
in your sample code above) and it returns a sorted array. orderBy doesn't know anything about key
and value
.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…