Skip to main content
Version: 9.0.0

ExtendedFormArray

ExtendedFormArray extends FormArray. Tracks the value and validity state of its elements - FormControl, FormGroup, FormStore or FormArray instances.

Constructor#

constructor(
controls: Array<AbstractControl>,
validatorOrOpts?: ValidatorFn | Array<ValidatorFn> | AbstractControlOptions | null,
asyncValidator?: AsyncValidatorFn | Array<AsyncValidatorFn> | null,
propertyOptions?: PropertyOptions
)

Properties#

get isChanged#

Returns true if current value is not equal to initial value, false otherwise.

PropertyReturn type
get isChanged()boolean

get currentValue#

Returns the current value of the control.

PropertyReturn type
get currentValue()Array<any>

get currentRawValue#

Returns the current value of the array, regardless of the disabled status of its controls .

PropertyReturn type
get currentRawValue()Array<any>

initialValue#

Getter and setter for initial value of the control.

PropertyReturn type
get initialValue()Array<any>
set initialValue()Array<any>

Methods#

clear()#

Removes all controls from the array. If clearFlags is true it also resets the array making it pristine and untouched, and sets the current value to [].

MethodReturn type
clear(clearFlags?: boolean)void

replaceWith()#

Replaces all controls from the array with new ones. If clearFlags is true it also resets the array making it pristine and untouched.

MethodReturn type
replaceWith(newItems: Array<any>, clearFlags?: boolean)void

resetValue()#

Resets the underlying form control, marking it pristine and untouched and sets the current and initial value to the one provided. If no value argument is provided, sets those values to control.currentValue.

MethodReturn type
resetValue(value?: any)value: any