From 60aa6310bb9de096f5ddfe578d366277a531b209 Mon Sep 17 00:00:00 2001 From: Alexis Lahouze Date: Thu, 20 Jul 2017 22:52:33 +0200 Subject: [PATCH] Separate account form from modal. --- src/accounts/account.module.ts | 7 ++- src/accounts/accountEditModal.component.ts | 55 ++--------------- src/accounts/accountForm.component.ts | 72 ++++++++++++++++++++++ 3 files changed, 83 insertions(+), 51 deletions(-) create mode 100644 src/accounts/accountForm.component.ts diff --git a/src/accounts/account.module.ts b/src/accounts/account.module.ts index 439acfb..a818c64 100644 --- a/src/accounts/account.module.ts +++ b/src/accounts/account.module.ts @@ -13,6 +13,7 @@ import { AccountService } from './account.service'; import { AccountBalancesService } from './accountBalances.service'; import { AccountDeleteModalComponent } from './accountDeleteModal.component'; import { AccountEditModalComponent } from './accountEditModal.component'; +import { AccountFormComponent } from './accountForm.component'; @NgModule({ imports: [ @@ -29,11 +30,13 @@ import { AccountEditModalComponent } from './accountEditModal.component'; ], declarations: [ AccountDeleteModalComponent, - AccountEditModalComponent + AccountEditModalComponent, + AccountFormComponent ], entryComponents: [ AccountDeleteModalComponent, - AccountEditModalComponent + AccountEditModalComponent, + AccountFormComponent ] }) export class AccountModule {} diff --git a/src/accounts/accountEditModal.component.ts b/src/accounts/accountEditModal.component.ts index 4de215a..e2a2c92 100644 --- a/src/accounts/accountEditModal.component.ts +++ b/src/accounts/accountEditModal.component.ts @@ -1,5 +1,6 @@ // vim: set tw=80 ts=2 sw=2 sts=2: import { Component, Input } from '@angular/core'; +import { NgForm } from '@angular/forms'; import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'; @@ -13,57 +14,11 @@ import { Account } from './account';