The documentation for orderBy uses a function to rearrange the order of the result set, but I wanted to order my results by multiple fields, and the documentation didn’t seem to mention that.

Unfortunately, I can’t remember where I found the information (or I’d give credit where it is due), but.  Found it in my Google Dashboard search history, and this is a much better write up.  To order by multiple fields in a result set, simply wrap the fields in brackets:

<tr ng-repeat="role in groupRolesList | orderBy:['current','role_name']">

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.