I am trying to use ng-repeat with a dictionary style syntax and apply an order to the key value.
(key, value) in something | orderBy:'key'
It seems OrderBy isn't working as expected
Example here http://jsfiddle.net/mhXuW/
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">
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
.