aboutsummaryrefslogtreecommitdiffstats
path: root/src/angular/form-elements/validation/validatable.component.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/angular/form-elements/validation/validatable.component.ts')
-rw-r--r--src/angular/form-elements/validation/validatable.component.ts8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/angular/form-elements/validation/validatable.component.ts b/src/angular/form-elements/validation/validatable.component.ts
index 4817dea..3201e0b 100644
--- a/src/angular/form-elements/validation/validatable.component.ts
+++ b/src/angular/form-elements/validation/validatable.component.ts
@@ -1,24 +1,24 @@
-import { Input, Component } from "@angular/core";
-import { ValidationComponent } from './validation.component';
import { Subject } from 'rxjs/Subject';
import { IValidatableComponent } from './validatable.interface';
export abstract class ValidatableComponent implements IValidatableComponent {
// Each ValidatableComponent should handle the style in case of error, according to this boolean
- public valid = true;
-
+ public valid: boolean;
+ public dirty: boolean;
// Each ValidatableComponent will notify when the value is changed.
public notifier: Subject<string>;
constructor() {
this.notifier = new Subject();
+ this.dirty = false;
}
public abstract getValue(): any;
// Each ValidatableComponent should call the valueChanged on value changed function.
protected valueChanged = (value: any): void => {
+ this.dirty = true;
this.notifier.next(value);
}