From e68db9f54af2b6f5490c6bb893f52d472f832643 Mon Sep 17 00:00:00 2001 From: Alexis Lahouze Date: Fri, 4 Aug 2017 14:52:37 +0200 Subject: [PATCH] Improve Account form and edit modal. --- src/accounts/account.module.ts | 4 +- src/accounts/accountEditModal.component.ts | 19 +++-- src/accounts/accountForm.component.ts | 81 +++++++++++++--------- 3 files changed, 63 insertions(+), 41 deletions(-) diff --git a/src/accounts/account.module.ts b/src/accounts/account.module.ts index e19d292..92b0cc0 100644 --- a/src/accounts/account.module.ts +++ b/src/accounts/account.module.ts @@ -2,7 +2,7 @@ import { NgModule } from '@angular/core'; import { CommonModule } from '@angular/common'; -import { FormsModule } from '@angular/forms'; +import { ReactiveFormsModule } from '@angular/forms'; import { HttpClientModule } from '@angular/common/http'; import { RouterModule } from '@angular/router'; @@ -24,7 +24,7 @@ import { AccountListState } from './account.states' imports: [ HttpClientModule, CommonModule, - FormsModule, + ReactiveFormsModule, RouterModule.forChild([ AccountListState ]), diff --git a/src/accounts/accountEditModal.component.ts b/src/accounts/accountEditModal.component.ts index 5ee29b1..231ec5f 100644 --- a/src/accounts/accountEditModal.component.ts +++ b/src/accounts/accountEditModal.component.ts @@ -1,10 +1,11 @@ // vim: set tw=80 ts=2 sw=2 sts=2: -import { Component, Input } from '@angular/core'; +import { Component, Input, ViewChild } from '@angular/core'; import { NgForm } from '@angular/forms'; import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'; import { Account } from './account'; +import { AccountFormComponent } from './accountForm.component'; @Component({ selector: 'account-edit-modal', @@ -14,11 +15,11 @@ import { Account } from './account';