|
|
|
@ -60,10 +60,7 @@ export class ControlErrorsComponent extends StatefulComponent<State> implements |
|
|
|
|
|
|
|
public ngOnDestroy() { |
|
|
|
super.ngOnDestroy(); |
|
|
|
|
|
|
|
if (this.control && this.originalMarkAsTouched) { |
|
|
|
this.control['markAsTouched'] = this.originalMarkAsTouched; |
|
|
|
} |
|
|
|
this.restoreOriginalMarkAsTouchedFunction(); |
|
|
|
} |
|
|
|
|
|
|
|
public ngOnChanges() { |
|
|
|
@ -87,6 +84,7 @@ export class ControlErrorsComponent extends StatefulComponent<State> implements |
|
|
|
|
|
|
|
if (this.control !== control) { |
|
|
|
this.unsubscribeAll(); |
|
|
|
this.restoreOriginalMarkAsTouchedFunction(); |
|
|
|
|
|
|
|
this.control = control; |
|
|
|
|
|
|
|
@ -112,6 +110,12 @@ export class ControlErrorsComponent extends StatefulComponent<State> implements |
|
|
|
this.createMessages(); |
|
|
|
} |
|
|
|
|
|
|
|
private restoreOriginalMarkAsTouchedFunction() { |
|
|
|
if (this.control && this.originalMarkAsTouched) { |
|
|
|
this.control['markAsTouched'] = this.originalMarkAsTouched; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
private createMessages() { |
|
|
|
const errors: string[] = []; |
|
|
|
|
|
|
|
|