How can I get Angular's ng-repeat
directive to sort a list by each item's actual value, rather than by the value of a property on each item?
eg:
<ul>
<li ng-repeat="item in items | orderBy:'WHAT_GOES_HERE??'">{{item}}</li>
</ul>
Here's a fiddle to play with: http://jsbin.com/okatur/1/edit
I realize I could just do .sort()
on the array, but is that my only option?
{{item}}
? – John Woodruff Jul 29 '13 at 23:54