(feat) sorting capabilities in the addressbook module

This commit is contained in:
Ludovic Marcotte
2015-07-20 14:24:36 -04:00
parent e7a73413d5
commit 7c2cb259a2
3 changed files with 70 additions and 12 deletions

View File

@@ -18,6 +18,9 @@
vm.notSelectedComponent = notSelectedComponent;
vm.unselectCards = unselectCards;
vm.confirmDeleteSelectedCards = confirmDeleteSelectedCards;
vm.sort = sort;
vm.sortedBy = sortedBy;
function selectCard(card) {
$state.go('app.addressbook.card.view', {addressbookId: stateAddressbook.id, cardId: card.id});
@@ -80,6 +83,14 @@
// Delete failed
});
}
function sort(field) {
vm.selectedFolder.$filter('', { sort: field });
}
function sortedBy(field) {
return vm.selectedFolder.$query.sort == field;
}
}
angular