0
我試圖在Ionic Framework中構建一個應用程序,該應用程序使用$cordovaContacts
插件獲取手機聯繫人。一切正常,但我怎麼能按字母順序排列這些提取的聯繫人,例如從A到Z.我知道根據搜索關鍵字提取聯繫人,但我無法按字母順序獲取聯繫人....
$cordovaContacts.find({filter : '', fields: ['displayName']}).then(function(allContacts) {
for (var i = 0; i < allContacts.length ; i++) {
$scope.Contacts.push({
cid : allContacts[i]['id'],
cname: allContacts[i]['displayName'],
numbers: allContacts[i]['phoneNumbers']
});
}
});