The parent control.
A control is marked pristine unless the user has triggered
a change event on it.
The validation status of the control. There are four possible validation statuses:
These statuses are mutually exclusive, so a control cannot be both valid AND invalid or invalid AND disabled.
A control is marked touched once the user has triggered
a blur event on it.
A control is marked pristine once the user has triggered
a change event on it.
A control is disabled when its status === DISABLED.
Disabled controls are exempt from validation checks and are not included in the aggregate value of their ancestor controls.
A control is enabled as long as its status !== DISABLED.
In other words, it has a status of VALID, INVALID, or
PENDING.
A control is invalid when its status === INVALID.
In order to have this status, the control must have failed at least one of its validation checks.
Retrieves the top-level ancestor of this control.
A control is untouched if the user has not yet triggered
a blur event on it.
A control is valid when its status === VALID.
In order to have this status, the control must have passed all its validation checks.
Empties out the sync validator list.
Disables the control. This means the control will be exempt from validation checks and
excluded from the aggregate value of any parent. Its status is DISABLED.
If the control has children, all children will be disabled to maintain the model.
Enables the control. This means the control will be included in validation checks and the aggregate value of its parent. Its status is re-calculated based on its value and its validators.
If the control has children, all children will be enabled.
Retrieves a child control given the control's name or path.
Paths can be passed in as an array or a string delimited by a dot.
To get a control nested within a person sub-group:
this.form.get('person.name');-OR-
this.form.get(['person', 'name']);Returns error data if the control with the given path has the error specified. Otherwise returns null or undefined.
If no path is given, it checks for the error on the present control.
Returns true if the control with the given path has the error specified. Otherwise returns false.
If no path is given, it checks for the error on the present control.
Marks the control as untouched.
If the control has any children, it will also mark all children as untouched
to maintain the model, and re-calculate the touched status of all parent
controls.
Marks the control as touched.
This will also mark all direct ancestors as touched to maintain
the model.
Marks the control as touched.
This will also mark all direct ancestors as touched to maintain
the model.
Marks the control as untouched.
If the control has any children, it will also mark all children as untouched
to maintain the model, and re-calculate the touched status of all parent
controls.
Patches the value of a control.
This function is functionally the same as {@link FormControl#setValue setValue} at this level.
It exists for symmetry with {@link FormGroup#patchValue patchValue} on FormGroups and
FormArrays, where it does behave differently.
Remove errors on a form control.
This is used when validations are run manually by the user, rather than automatically.
Sets errors on a form control.
This is used when validations are run manually by the user, rather than automatically.
Sets the synchronous validators that are active on this control.
Set the value of the form control to value.
If onlySelf is true, this change will only affect the validation of this FormControl
and not its parent component. This defaults to false.
Re-calculates the value and validation status of the control.
By default, it will also update the value and validity of its ancestors.
Generated using TypeDoc
Returns any errors generated by failing validation. If there are no errors, it will return null.