Skip to content
Snippets Groups Projects
Commit 1ff51c20 authored by Albert Bruns's avatar Albert Bruns
Browse files

OZG-7974 small fix

parent 84483f69
Branches
Tags
1 merge request!116OZG-7974-Validierung-onSubmit
...@@ -28,12 +28,6 @@ describe('FormControlEditorAbstractComponent', () => { ...@@ -28,12 +28,6 @@ describe('FormControlEditorAbstractComponent', () => {
fixture.detectChanges(); fixture.detectChanges();
}); });
describe('constructor', () => {
it('should set control value accessor', () => {
expect(component.control.valueAccessor).toBe(component);
});
});
describe('ng on init', () => { describe('ng on init', () => {
it('should set valueChange subscription', () => { it('should set valueChange subscription', () => {
component.ngOnInit(); component.ngOnInit();
......
...@@ -42,12 +42,13 @@ export abstract class FormControlEditorAbstractComponent implements ControlValue ...@@ -42,12 +42,13 @@ export abstract class FormControlEditorAbstractComponent implements ControlValue
constructor(@Self() @Optional() public control: NgControl | null) { constructor(@Self() @Optional() public control: NgControl | null) {
if (this.control) this.control.valueAccessor = this; if (this.control) this.control.valueAccessor = this;
}
ngOnInit(): void {
this._changesSubscr = this.fieldControl.valueChanges.subscribe((value: unknown) => { this._changesSubscr = this.fieldControl.valueChanges.subscribe((value: unknown) => {
this._fieldControlOnChangeHandler(value); this._fieldControlOnChangeHandler(value);
}); });
}
ngOnInit(): void {
if (this.control) { if (this.control) {
this._statusSubscr = this.control.statusChanges.subscribe(() => { this._statusSubscr = this.control.statusChanges.subscribe(() => {
this.setErrors(); this.setErrors();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment