From d4d3baba3133a547927fe9b53f825d95dcfa22d0 Mon Sep 17 00:00:00 2001 From: Alexis Lahouze Date: Thu, 14 Jun 2018 09:28:51 +0200 Subject: [PATCH] Remove unused form component. --- src/operations/operationEdit.component.ts | 1 - src/operations/operationForm.component.ts | 122 ---------------------- 2 files changed, 123 deletions(-) delete mode 100644 src/operations/operationForm.component.ts diff --git a/src/operations/operationEdit.component.ts b/src/operations/operationEdit.component.ts index 20a81ac..d24f6f7 100644 --- a/src/operations/operationEdit.component.ts +++ b/src/operations/operationEdit.component.ts @@ -9,7 +9,6 @@ import { ToastrService } from 'ngx-toastr'; import { Operation } from './operation'; import { OperationService } from './operation.service'; -import { OperationFormComponent } from './operationForm.component'; @Component({ selector: 'operation-new', diff --git a/src/operations/operationForm.component.ts b/src/operations/operationForm.component.ts deleted file mode 100644 index ac71bae..0000000 --- a/src/operations/operationForm.component.ts +++ /dev/null @@ -1,122 +0,0 @@ -// vim: set tw=80 ts=2 sw=2 sts=2 : -import { Component, OnInit, OnChanges, Input, Output, EventEmitter } from '@angular/core'; -import { FormBuilder, FormGroup, Validators } from '@angular/forms'; - -import { Operation } from './operation'; - -@Component({ - selector: 'operation-form', - exportAs: 'operationForm', - template: ` -
-
- - -
- - -
-

The operation date is required.

-
-
-
- -
- - -
- - -
-

The operation label is required.

-
-
-
- -
- - -
- - -
-

The operation value is required.

-
-
-
- -
- - -
- - -
-

The operation category is required.

-
-
-
-
- ` -}) -export class OperationFormComponent implements OnInit { - public form: FormGroup; - @Input() operation: Operation; - @Output() submitEventEmitter: EventEmitter = new EventEmitter(); - - //dateMask = [/\d{4}/, '-', /0[1-9]|1[0-2]/, '-', /[0-2]\d|3[0-1]/]; - dateMask = ['2', '0', /\d/, /\d/, '-', /[0-1]/, /\d/, '-', /[0-3]/, /\d/]; - - constructor(private formBuilder: FormBuilder) {} - - ngOnInit() { - this.form = this.formBuilder.group({ - operationDate: ['', Validators.required], - label: ['', Validators.required], - value: ['', Validators.required], - category: ['', Validators.required], - }); - - this.form.patchValue({ - operationDate: this.operation.operation_date, - label: this.operation.label, - value: this.operation.value, - category: this.operation.category, - }); - } - - submit() { - if(this.form.valid) { - this.submitEventEmitter.emit(); - } - } - - get operationDate() { - return this.form.get('operationDate'); - } - - get label() { - return this.form.get('label'); - } - - get value() { - return this.form.get('value'); - } - - get category() { - return this.form.get('category'); - } -}