Dissociate new account modal from editing account on AccountListComponent.

This commit is contained in:
Alexis Lahouze 2017-07-21 00:41:04 +02:00
parent 79d55bfc44
commit f8fa34f269

View File

@ -160,7 +160,17 @@ export class AccountListComponent {
* Add an empty account.
*/
add() {
return this.modify(new Account());
const modal = this.NgbModal.open(AccountEditModalComponent, {
windowClass: 'in'
});
modal.componentInstance.account = new Account();
modal.result.then((account: Account) => {
this.Logger.log("Modal closed => save account", account);
this.save(account);
}, (reason) => function(reason) {
});
};
/*