diff --git a/alfa-client/libs/design-component/src/lib/form/formcontrol-editor.abstract.component.ts b/alfa-client/libs/design-component/src/lib/form/formcontrol-editor.abstract.component.ts index 0e77b51c101f31ac094b7c59f6fbae9834f76b9a..89c0cd5fb117bc5c11c2aa254dfd810ec7616b32 100644 --- a/alfa-client/libs/design-component/src/lib/form/formcontrol-editor.abstract.component.ts +++ b/alfa-client/libs/design-component/src/lib/form/formcontrol-editor.abstract.component.ts @@ -64,12 +64,15 @@ export abstract class FormControlEditorAbstractComponent implements ControlValue this.fieldControl.setValue(text); this.setErrors(); } + registerOnChange(fn: (text: string | Date) => {}): void { this.onChange = fn; } + registerOnTouched(fn: () => {}): void { this.onTouched = fn; } + setDisabledState?(isDisabled: boolean): void { this.disabled = isDisabled; } @@ -83,9 +86,9 @@ export abstract class FormControlEditorAbstractComponent implements ControlValue if (this.control) { this.fieldControl.setErrors(this.control.errors); if (this.control.invalid) { - this._updateInvalidParams(); this.fieldControl.markAsTouched(); } + this._updateInvalidParams(); } }