diff --git a/src/scheduler/schedule.module.ts b/src/scheduler/schedule.module.ts index acc847c..e8c5c9a 100644 --- a/src/scheduler/schedule.module.ts +++ b/src/scheduler/schedule.module.ts @@ -12,6 +12,7 @@ import { ToastrModule } from 'ngx-toastr'; import { ScheduleService } from './schedule.service'; import { ScheduleDeleteModalComponent } from './scheduleDeleteModal.component'; +import { ScheduleFormComponent } from './scheduleForm.component'; import { ScheduleRowComponent } from './scheduleRow.component'; import { ScheduleListComponent } from './scheduleList.component'; @@ -47,11 +48,13 @@ export function accountIdServiceFactory(i: any) { ], declarations: [ ScheduleDeleteModalComponent, + ScheduleFormComponent, ScheduleListComponent, ScheduleRowComponent ], entryComponents: [ ScheduleDeleteModalComponent, + ScheduleFormComponent, ScheduleListComponent, ScheduleRowComponent ] diff --git a/src/scheduler/scheduleForm.component.ts b/src/scheduler/scheduleForm.component.ts new file mode 100644 index 0000000..8d1ea33 --- /dev/null +++ b/src/scheduler/scheduleForm.component.ts @@ -0,0 +1,86 @@ +// vim: set tw=80 ts=2 sw=2 sts=2 : +import { AfterViewChecked, Component, EventEmitter, Input, Output, ViewChild } from '@angular/core'; +import { NgForm } from '@angular/forms'; + +import { Logger } from '@nsalaun/ng-logger'; +import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'; + +import { Schedule } from './schedule'; + +@Component({ + selector: 'schedule-form', + template: ` +
+
+ +
+ +
+
+ +
+ +
+ +
+
+ +
+ +
+ +
+
+ +
+ +
+ +
+
+ +
+ +
+ +
+
+ +
+ +
+ +
+
+ +
+ +
+ +
+
+
+ ` +}) +export class ScheduleFormComponent implements AfterViewChecked { + @Input() schedule: Schedule; + @Output() onValid: EventEmitter = new EventEmitter(); + @ViewChild('form') form: NgForm; + + constructor() {} + + ngAfterViewChecked() { + this.onValid.emit(this.form.form.valid); + } +}