From 13670f0317c91b33740911c94f167a2df3269be8 Mon Sep 17 00:00:00 2001 From: Alexis Lahouze Date: Sun, 13 Aug 2017 12:28:10 +0200 Subject: [PATCH] Migrate to reactive forms in operation module. --- src/operations/operation.module.ts | 4 +- .../operationEditModal.component.ts | 19 ++- src/operations/operationForm.component.ts | 114 +++++++++++++----- 3 files changed, 104 insertions(+), 33 deletions(-) diff --git a/src/operations/operation.module.ts b/src/operations/operation.module.ts index 1417b49..33c5f74 100644 --- a/src/operations/operation.module.ts +++ b/src/operations/operation.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'; @@ -26,7 +26,7 @@ import { OperationListState } from './operation.states' imports: [ HttpClientModule, CommonModule, - FormsModule, + ReactiveFormsModule, RouterModule.forChild([ OperationListState ]), diff --git a/src/operations/operationEditModal.component.ts b/src/operations/operationEditModal.component.ts index 987287a..eee4260 100644 --- a/src/operations/operationEditModal.component.ts +++ b/src/operations/operationEditModal.component.ts @@ -1,9 +1,10 @@ // vim: set tw=80 ts=2 sw=2 sts=2: -import { Component, Input } from '@angular/core'; +import { Component, Input, ViewChild } from '@angular/core'; import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'; import { Operation } from './operation'; +import { OperationFormComponent } from './operationForm.component'; @Component({ selector: 'operation-edit-modal', @@ -13,11 +14,11 @@ import { Operation } from './operation';