(js) Improve addressbook renaming

The AddressBook instance to list the cards is now the same as the one
from the list of addressbooks. Therefore, when renaming an addressbook,
the addressbook name in the list is automatically updated.
This commit is contained in:
Francis Lachapelle
2015-11-09 14:46:30 -05:00
parent dc3e42fd62
commit cc5cc30c24
4 changed files with 23 additions and 14 deletions
@@ -249,10 +249,13 @@
vm.close = close;
function saveProperties() {
vm.addressbook.$save();
// Refresh list instance
srcAddressBook.init(vm.addressbook.$omit());
$mdDialog.hide();
vm.addressbook.$save().then(function() {
// Refresh list instance
srcAddressBook.init(vm.addressbook.$omit());
$mdDialog.hide();
}, function() {
// TODO handle error
});
}
function close() {