orderBy two fields (one in reverse)

后端 未结 3 1184
野趣味
野趣味 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:24

    In Angular 1.5.8 previous example does not work. Different logic has to be applied.

    It looks logic from previous orderBy is applied to the next one, so in order to sort name ASC and status DESC name order has to be reveresed:

  • Here is fixed example: http://plnkr.co/edit/0ZFIftSgNkU9F03xJztG?p=preview

提交回复
热议问题