Sorting in ionic - the orderBy conundrum

Hi there, i was wondering if it’s possible to do the equivalent of an orderBy statement when building an ion-list.

I have a dataset of leaders (sales) and i want to order this by the value against each salesperson in a field called ‘balance’.

I want to sort the list by this descending, to create the sales leaderboard…

can i do this on the client side? I have all the data in the model…

You should be able to use Angular’s orderBy filter, unless I’m misunderstanding you: https://docs.angularjs.org/api/ng/filter/orderBy

Is this what you’re looking for?

2 Likes

BOOM! exactly :slight_smile:

Thanks!!

1 Like