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