When iterating through my ng-repeat, I need a specific order for my items. I know I can use a list of properties to set the order:
ng-repeat="client in clients | orderBy: ['isOpen', 'lastAccessTime']"
My question is, how can I specify ascending and descending orders?
I want the primary sorting based on isOpen
in DESC order, and secondary sorting based on lastAccessTime
in ASC order. How can I achieve this in my ng-repeat
loop?
EDIT: I attempted the following approach, but when two items share the same isOpen
value, the item with the highest lastAccessTime
does not appear at the top:
ng-repeat="client in clients | orderBy: 'isOpen':true | orderBy: 'lastAccessTime'"