orderBy two fields (one in reverse)

后端 未结 3 1166
野趣味
野趣味 2021-02-03 17:36

I would like to order a friend list by status (online firsts, offline lasts) and by alphabetical order. All I manage to get is:

  • Online firsts / Reversed alphabetic
3条回答
  •  伪装坚强ぢ
    2021-02-03 18:22

    There is another option to do that, you can have multiple orderBy filter in ng-repeat and that line :

  • will be :

  • The last orderBy is execute first and the second to last etc ...

    Here is my plunkr : http://plnkr.co/edit/girPFzdi3Zx0yp0ASGVQ?p=preview

提交回复
热议问题