ControlGroup class

Defines a part of a form, of fixed length, that can contain other controls.

A ControlGroup aggregates the values of each Control in the group. The status of a ControlGroup depends on the status of its children. If one of the controls in a group is invalid, the entire group is invalid. Similarly, if a control changes its value, the entire group changes as well.

ControlGroup is one of the three fundamental building blocks used to define forms in Angular, along with Control and ControlArray. ControlArray can also contain other controls, but is of variable length.

Inheritance

Constructors

ControlGroup(Map<String, AbstractControl> controls, [ ValidatorFn validator ])

Properties

controls → Map<String, AbstractControl>
final, inherited
dirty → bool
read-only, inherited
disabled → bool
read-only, inherited
disabledChanges → Stream<bool>
read-only, inherited
enabled → bool
read-only, inherited
errors → Map<String, dynamic>
Returns the errors of this control.
read-only, inherited
hashCode → int
The hash code for this object. [...]
read-only, inherited
invalid → bool
read-only, inherited
pending → bool
read-only, inherited
pristine → bool
read-only, inherited
root AbstractControl
read-only, inherited
runtimeType → Type
A representation of the runtime type of the object.
read-only, inherited
status → String
The validation status of the control.
read-only, inherited
statusChanges → Stream<String>
read-only, inherited
touched → bool
read-only, inherited
untouched → bool
read-only, inherited
valid → bool
read-only, inherited
validator ValidatorFn
read / write, inherited
value → Map<String, dynamic>
read-only, inherited
valueChanges → Stream<Map<String, dynamic>>
read-only, inherited

Methods

onUpdate() → void
Callback when control is asked to update it's value. [...]
override
updateValue(Map<String, dynamic> value, { bool onlySelf, bool emitEvent, bool emitModelToViewChange, String rawValue }) → void
Set the value of the AbstractControl to value. [...]
override
addControl(String name, AbstractControl control) → void
Add a control to this group.
inherited
contains(String controlName) → bool
Check whether there is a control with the given name in the group.
inherited
find(String path) AbstractControl
Walks the path supplied to find matching control. [...]
inherited
findPath(List<String> path) AbstractControl
Walks the path to find the matching control. [...]
inherited
getError(String errorCode, [ List<String> path ]) → dynamic
inherited
hasError(String errorCode, [ List<String> path ]) → bool
inherited
included(String controlName) → bool
@protected, inherited
markAsDirty({bool onlySelf, bool emitEvent }) → void
Mark the control as dirty. [...]
inherited
markAsDisabled({bool updateParent, bool emitEvent }) → void
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. [...]
inherited
markAsEnabled({bool updateParent, bool emitEvent }) → void
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. [...]
inherited
markAsPending({bool onlySelf }) → void
inherited
markAsPristine({bool updateParent }) → void
Marks the control as pristine. [...]
inherited
markAsTouched({bool updateParent }) → void
Marks the control as touched. [...]
inherited
markAsUntouched({bool updateParent }) → void
Marks the control as untouched. [...]
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
removeControl(String name) → void
Remove a control from this group.
inherited
reset({Map<String, dynamic> value, bool isDisabled, bool updateParent, bool emitEvent }) → void
Resets the form control. [...]
inherited
setErrors(Map<String, dynamic> errors, { bool emitEvent }) → void
Sets errors on a control. [...]
inherited
setParent(AbstractControl parent) → void
inherited
toString() → String
Returns a string representation of this object.
inherited
updateValueAndValidity({bool onlySelf, bool emitEvent }) → void
inherited

Operators

operator ==(dynamic other) → bool
The equality operator. [...]
inherited