Skip to main content
Version: 8.x.x

Extended form controls

When you use FormObjectBuilder to build forms from models, extended versions of form groups and controls will be created. All of the extended controls add functionality to either FormGroup, FormControl or FormArray. For the most part, you can treat extended form controls just like you would regular Angular form controls.

ExtendedFormControl#

ExtendedFormControl extends FormControl. It exposes the following public properties:

PropertyReturn typeDescription
get isChanged()booleanReturns true if current value is not equal to initial value, false otherwise
get currentValue()anyReturns the current value of the control
get initialValue()anyReturns the initial value of the control
set initialValue(value:any)Sets the initial value of the control
resetValue(value: any)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

ExtendedFormArray#

ExtendedFormArray extends FormArray. It exposes the following public properties:

PropertyReturn typeDescription
isChangedbooleanReturns true if current value is not equal to initial value, false otherwise
get currentValueArray<any>Returns the current value of the control
get initialValue()Array<any>Returns the initial value of the control
set initialValue(value: Array<any>)Sets the initial value of the control
get currentRawValue()Array<any>Returns the current value of the array, regardless of the disabled status of its controls
resetValue(value?: any)value: anyResets 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
clear(clearFlags?: boolean)Removes all controls from the array. If clearFlags is true it also resets the array making it pristine and untouched

FormStore#

FormStore extends FormGroup. It exposes the following public properties:

PropertyReturn typeDescription
get isChanged()booleanReturns true if cany of FormStore's controls or relationships have changed
set formObject(formObject: FormObject)Sets the FormObject for this FormStore
get formObject()FormObjectReturns the underlying FormObject instance
get model()anyReturns the model which the FormObject and FormStore were created with
save()Observable<any>Initiates the forms save chain. Calls FormObjects save hooks and FormObject.save(). Check FormObject for more details