Skip to content

FormUtils

class
class FormUtils {
static getErrorState(control: AbstractControl): boolean;
static mergeInnerErrors(host: AbstractControl, inner: AbstractControl): void;
}
getErrorState(control: AbstractControl): boolean
NameTypeDescription
controlAbstractControl

Writes the errors of a form element’s inner control onto the hosting control without dropping the host’s own validation result (e.g. required set up by the surrounding form). host.setErrors(inner.errors) alone would wipe those whenever the inner control is valid.

mergeInnerErrors(host: AbstractControl, inner: AbstractControl): void
NameTypeDescription
hostAbstractControl
innerAbstractControl