From 0600c1b653112edb7603f119f15d6e65e1bd12f8 Mon Sep 17 00:00:00 2001 From: Alexis Lahouze Date: Fri, 11 Aug 2017 23:15:07 +0200 Subject: [PATCH] Switch to reactive forms in schedule module. --- src/scheduler/schedule.module.ts | 4 +- src/scheduler/scheduleEditModal.component.ts | 23 ++- src/scheduler/scheduleForm.component.ts | 180 +++++++++++++++---- 3 files changed, 163 insertions(+), 44 deletions(-) diff --git a/src/scheduler/schedule.module.ts b/src/scheduler/schedule.module.ts index d66145b..a6b980f 100644 --- a/src/scheduler/schedule.module.ts +++ b/src/scheduler/schedule.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'; @@ -23,7 +23,7 @@ import { ScheduleListState } from './schedule.states'; imports: [ HttpClientModule, CommonModule, - FormsModule, + ReactiveFormsModule, RouterModule.forChild([ ScheduleListState ]), diff --git a/src/scheduler/scheduleEditModal.component.ts b/src/scheduler/scheduleEditModal.component.ts index 98258f8..02ef752 100644 --- a/src/scheduler/scheduleEditModal.component.ts +++ b/src/scheduler/scheduleEditModal.component.ts @@ -1,10 +1,10 @@ // vim: set tw=80 ts=2 sw=2 sts=2: -import { Component, Input } from '@angular/core'; -import { NgForm } from '@angular/forms'; +import { Component, Input, ViewChild } from '@angular/core'; import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'; import { Schedule } from './schedule'; +import { ScheduleFormComponent } from './scheduleForm.component'; @Component({ selector: 'schedule-edit-modal', @@ -14,11 +14,11 @@ import { Schedule } from './schedule';