Mailing List: Contact List Sort

In the phone run I get all the contact details. After getting all the details, I will try to sort the list according to the alphabetical order of the name. It is sorted, but it takes about 30 seconds to sort the list. How to optimize the list.

function onSuccess(contacts) { contacts = contacts.sort(cSort); } var cSort = function(a, b) { aName = a.displayName ; bName = b.displayName ; return aName < bName ? -1 : (aName == bName ? 0 : 1); }; 

Thanks at Advance.

+5
source share
1 answer

If you sort contacts to display them, why not just use the ng-repeat, a and orderBy filters?

That would greatly optimize things!

0
source

All Articles