From f8fa34f269b27e24dc02cf753cfa3e1c4b68a31b Mon Sep 17 00:00:00 2001 From: Alexis Lahouze Date: Fri, 21 Jul 2017 00:41:04 +0200 Subject: [PATCH] Dissociate new account modal from editing account on AccountListComponent. --- src/accounts/accountList.component.ts | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/accounts/accountList.component.ts b/src/accounts/accountList.component.ts index a5c350b..5522195 100644 --- a/src/accounts/accountList.component.ts +++ b/src/accounts/accountList.component.ts @@ -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) { + }); }; /*