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, [ Map<String, bool> optionals = null, ValidatorFn validator = null, AsyncValidatorFn asyncValidator = null ])

Properties

asyncValidator → AsyncValidatorFn

read / write, inherited
controls → Map<String, AbstractControl>

read / write
dirty → bool

read-only, inherited
errors → Map<String, dynamic>

Returns the errors of this control.

read-only, inherited
hashCode → int

Get a hash code for this object.

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

read-only, inherited
statusChanges Stream

read-only, inherited
touched → bool

read-only, inherited
untouched → bool

read-only, inherited
valid → bool

read-only, inherited
validator ValidatorFn

read / write, inherited
value → dynamic

read-only, inherited
valueChanges Stream

read-only, inherited

Operators

operator ==(other) → bool

The equality operator.

inherited

Methods

addControl(String name, AbstractControl control) → void

Add a control to this group.

contains(String controlName) → bool

Check whether there is a control with the given name in the group.

exclude(String controlName) → void

Mark the named control as optional.

find(path) AbstractControl

inherited
getError(String errorCode, [ List<String> path ]) → dynamic

inherited
hasError(String errorCode, [ List<String> path = null ]) → bool

inherited
include(String controlName) → void

Mark the named control as non-optional.

markAsDirty({bool onlySelf }) → void

inherited
markAsPending({bool onlySelf }) → void

inherited
markAsTouched() → void

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.

setErrors(Map<String, dynamic> errors, { bool emitEvent }) → void

Sets errors on a control.

inherited
setParent(parent) → void

inherited
toString() → String

Returns a string representation of this object.

inherited
updateValueAndValidity({bool onlySelf, bool emitEvent }) → void

inherited