GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing next.angular.dev — FormArray • Angular API Creates a new @paramcontrols TControl[]An array of child controls. Each child control is given an index where it is registered. @paramvalidatorOrOpts ValidatorFn | AbstractControlOptions | ValidatorFn[] | null | undefinedA synchronous validator function, or an array of
such functions, or an @paramasyncValidator AsyncValidatorFn | AsyncValidatorFn[] | null | undefinedA single async validator or array of async validator functions @returns FormArray<TControl>Get the @paramindex numberIndex in the array to retrieve the control. If @returns ɵTypedOrUntyped<TControl, TControl, AbstractControl<any, any, any>>Insert a new @paramcontrol TControl | TControl[]Form control to be inserted @paramoptions { emitEvent?: boolean | undefined; }Specifies whether this FormArray instance should emit events after a new control is added.
NOTE: Pushing to the FormArray will not mark it dirty. If you want to mark if dirty, call @returns voidInsert a new @paramindex numberIndex in the array to insert the control. If @paramcontrol TControlForm control to be inserted @paramoptions { emitEvent?: boolean | undefined; }Specifies whether this FormArray instance should emit events after a new control is inserted.
NOTE: Inserting to the FormArray will not mark it dirty. If you want to mark if dirty, call @returns voidRemove the control at the given @paramindex numberIndex in the array to remove the control. If @paramoptions { emitEvent?: boolean | undefined; }Specifies whether this FormArray instance should emit events after a control is removed.
NOTE: Removing the FormArray will not mark it dirty. If you want to mark if dirty, call @returns voidReplace an existing control. @paramindex numberIndex in the array to replace the control. If @paramoptions { emitEvent?: boolean | undefined; }Specifies whether this FormArray instance should emit events after an existing control is replaced with a new one.
@returns voidLength of the control array. Sets the value of the This method performs strict checks, and throws an error if you try to set the value of a control that doesn't exist or if you exclude the value of a control. @paramvalue ɵIsAny<TControl, any[], ɵRawValue<TControl>[]>Array of values for the controls @paramoptions { onlySelf?: boolean | undefined; emitEvent?: boolean | undefined; }Configure options that determine how the control propagates changes and emits events after the value changes
@returns voidUsage notes Set the values for the controls in the form array
Patches the value of the It accepts both super-sets and sub-sets of the array without throwing an error. @paramvalue ɵIsAny<TControl, any[], ɵValue<TControl>[]>Array of latest values for the controls @paramoptions { onlySelf?: boolean | undefined; emitEvent?: boolean | undefined; }Configure options that determine how the control propagates changes and emits events after the value changes
@returns voidUsage notes Patch the values for controls in a form array
Resets the You reset to a specific form state by passing in an array of states that matches the structure of the control. The state is a standalone value or a form state object with both a value and a disabled status. @paramvalue ɵTypedOrUntyped<TControl, ɵIsAny<TControl, any[], ɵValue<TControl>[]>, any>Array of values for the controls @paramoptions { onlySelf?: boolean | undefined; emitEvent?: boolean | undefined; overwriteDefaultValue?: boolean | undefined; }Configure options that determine how the control propagates changes and emits events after the value changes
@returns voidUsage notes Reset the values in a form array
Reset the values in a form array and the disabled status for the first control
The aggregate value of the array, including any disabled controls. Reports all values regardless of disabled status. @returns ɵIsAny<TControl, any[], ɵRawValue<TControl>[]>Remove all controls in the @paramoptions { emitEvent?: boolean | undefined; }Specifies whether this FormArray instance should emit events after all controls are removed.
@returns voidUsage notes Remove all elements from a FormArray
It's a simpler and more efficient alternative to removing all elements one by one:
The current value of the control.
Returns the function that is used to determine the validity of this control synchronously.
If multiple validators have been added, this will be a single composed function.
See Returns the function that is used to determine the validity of this control asynchronously.
If multiple validators have been added, this will be a single composed function.
See The parent control. The validation status of the control. A control is A control is A control is A control is Disabled controls are exempt from validation checks and are not included in the aggregate value of their ancestor controls. A control is An object containing any errors generated by failing validation, or null if there are no errors. A control is A control is True if the control is marked as A control is marked True if the control has not been marked as touched A control is A multicasting observable that emits an event every time the state of the control changes. It emits for value, status, pristine or touched changes. Note: On value change, the emit happens right after a value of this control is updated. The
value of a parent control (for example if this FormControl is a part of a FormGroup) is updated
later, so accessing a value of a parent control (using the A multicasting observable that emits an event every time the value of the control changes, in the UI or programmatically. It also emits an event each time you call enable() or disable() without passing along {emitEvent: false} as a function argument. Note: the emit happens right after a value of this control is updated. The value of a
parent control (for example if this FormControl is a part of a FormGroup) is updated later, so
accessing a value of a parent control (using the A multicasting observable that emits an event every time the validation Reports the update strategy of the Sets the synchronous validators that are active on this control. Calling this overwrites any existing synchronous validators. When you add or remove a validator at run time, you must call
If you want to add a new validator without affecting existing ones, consider
using @returns voidSets the asynchronous validators that are active on this control. Calling this overwrites any existing asynchronous validators. When you add or remove a validator at run time, you must call
If you want to add a new validator without affecting existing ones, consider
using @returns voidAdd a synchronous validator or validators to this control, without affecting other validators. When you add or remove a validator at run time, you must call
Adding a validator that already exists will have no effect. If duplicate validator functions
are present in the @paramvalidators ValidatorFn | ValidatorFn[]The new validator function or functions to add to this control. @returns voidAdd an asynchronous validator or validators to this control, without affecting other validators. When you add or remove a validator at run time, you must call
Adding a validator that already exists will have no effect. @paramvalidators AsyncValidatorFn | AsyncValidatorFn[]The new asynchronous validator function or functions to add to this control. @returns voidRemove a synchronous validator from this control, without affecting other validators. Validators are compared by function reference; you must pass a reference to the exact same validator function as the one that was originally set. If a provided validator is not found, it is ignored. @returns voidUsage notes
When you add or remove a validator at run time, you must call
Remove an asynchronous validator from this control, without affecting other validators. Validators are compared by function reference; you must pass a reference to the exact same validator function as the one that was originally set. If a provided validator is not found, it is ignored. When you add or remove a validator at run time, you must call
@paramvalidators AsyncValidatorFn | AsyncValidatorFn[]The asynchronous validator or validators to remove. @returns voidCheck whether a synchronous validator function is present on this control. The provided validator must be a reference to the exact same function that was provided. @returns booleanWhether the provided validator was found on this control. Usage notes
Check whether an asynchronous validator function is present on this control. The provided validator must be a reference to the exact same function that was provided. @paramvalidator AsyncValidatorFnThe asynchronous validator to check for presence. Compared by function reference. @returns booleanWhether the provided asynchronous validator was found on this control. Empties out the synchronous validator list. When you add or remove a validator at run time, you must call
@returns voidEmpties out the async validator list. When you add or remove a validator at run time, you must call
@returns voidMarks the control as @paramopts { onlySelf?: boolean | undefined; emitEvent?: boolean | undefined; } | undefinedConfiguration options that determine how the control propagates changes and emits events after marking is applied.
@returns void@paramopts { onlySelf?: boolean | undefined; emitEvent?: boolean | undefined; sourceControl?: AbstractControl<any, any, any> | undefined; } | undefined@returns voidMarks the control and all its descendant controls as @paramopts { emitEvent?: boolean | undefined; }Configuration options that determine how the control propagates changes and emits events after marking is applied.
@returns voidMarks the control and all its descendant controls as @paramopts { emitEvent?: boolean | undefined; }Configuration options that determine how the control propagates changes and emits events after marking is applied.
@returns voidMarks the control as If the control has any children, also marks all children as @paramopts { onlySelf?: boolean | undefined; emitEvent?: boolean | undefined; } | undefinedConfiguration options that determine how the control propagates changes and emits events after the marking is applied.
@returns void@paramopts { onlySelf?: boolean | undefined; emitEvent?: boolean | undefined; sourceControl?: AbstractControl<any, any, any> | undefined; }@returns voidMarks the control as @paramopts { onlySelf?: boolean | undefined; emitEvent?: boolean | undefined; } | undefinedConfiguration options that determine how the control propagates changes and emits events after marking is applied.
@returns void@paramopts { onlySelf?: boolean | undefined; emitEvent?: boolean | undefined; sourceControl?: AbstractControl<any, any, any> | undefined; }@returns voidMarks the control as If the control has any children, marks all children as @paramopts { onlySelf?: boolean | undefined; emitEvent?: boolean | undefined; } | undefinedConfiguration options that determine how the control emits events after marking is applied.
@returns void@paramopts { onlySelf?: boolean | undefined; emitEvent?: boolean | undefined; sourceControl?: AbstractControl<any, any, any> | undefined; }@returns voidMarks the control as A control is pending while the control performs async validation. @paramopts { onlySelf?: boolean | undefined; emitEvent?: boolean | undefined; } | undefinedConfiguration options that determine how the control propagates changes and emits events after marking is applied.
@returns void@paramopts { onlySelf?: boolean | undefined; emitEvent?: boolean | undefined; sourceControl?: AbstractControl<any, any, any> | undefined; }@returns voidDisables the control. This means the control is exempt from validation checks and
excluded from the aggregate value of any parent. Its status is If the control has children, all children are also disabled. @paramopts { onlySelf?: boolean | undefined; emitEvent?: boolean | undefined; } | undefinedConfiguration options that determine how the control propagates changes and emits events after the control is disabled.
@returns void@paramopts { onlySelf?: boolean | undefined; emitEvent?: boolean | undefined; sourceControl?: AbstractControl<any, any, any> | undefined; }@returns voidEnables the control. This means the control is included in validation checks and the aggregate value of its parent. Its status recalculates based on its value and its validators. By default, if the control has children, all children are enabled. @paramopts { onlySelf?: boolean | undefined; emitEvent?: boolean | undefined; }Configure options that control how the control propagates changes and emits events when marked as untouched
@returns voidRecalculates the value and validation status of the control. By default, it also updates the value and validity of its ancestors. @paramopts { onlySelf?: boolean | undefined; emitEvent?: boolean | undefined; } | undefinedConfiguration options determine how the control propagates changes and emits events after updates and validity checks are applied.
@returns void@paramopts { onlySelf?: boolean | undefined; emitEvent?: boolean | undefined; sourceControl?: AbstractControl<any, any, any> | undefined; }@returns voidSets errors on a form control when running validations manually, rather than automatically. Calling Note: Manually set errors are always overwritten by the results of the next validation run. @paramopts { emitEvent?: boolean | undefined; } | undefinedConfiguration options that determine how the control propagates changes and emits events after the control errors are set.
@returns voidUsage notes Manually set the errors for a control
@paramopts { emitEvent?: boolean | undefined; shouldHaveEmitted?: boolean | undefined; } | undefined@returns voidRetrieves a child control given the control's name or path. This signature for get supports strings and @parampath P@returns AbstractControl<ɵGetProperty<TRawValue, P>, ɵGetProperty<TRawValue, P>, any> | nullRetrieves a child control given the control's name or path. This signature for @parampath P@returns AbstractControl<ɵGetProperty<TRawValue, P>, ɵGetProperty<TRawValue, P>, any> | nullReports error data for the control with the given path. @paramerrorCode stringThe code of the error to check @parampath string | (string | number)[] | undefinedA list of control names that designates how to move from the current control to the control that should be queried for errors. @returns anyerror data for that particular error. If the control or error is not present, null is returned. Usage notes For example, for the following
The path to the 'street' control from the root form would be 'address' -> 'street'. It can be provided to this method in one of two formats:
Reports whether the control with the given path has the error specified. @paramerrorCode stringThe code of the error to check @parampath string | (string | number)[] | undefinedA list of control names that designates how to move from the current control to the control that should be queried for errors. @returns booleanwhether the given error is present in the control at the given path. If the control is not present, false is returned. Usage notes For example, for the following
The path to the 'street' control from the root form would be 'address' -> 'street'. It can be provided to this method in one of two formats:
If no path is given, this method checks for the error on the current control. Retrieves the top-level ancestor of this control. DescriptionTracks the value and validity state of an array of A
Usage NotesCreate an array of form controls
Create a form array with array-level validatorsYou include array-level validators and async validators. These come in handy when you want to perform validation that considers the value of more than one child control. The two types of validators are passed in separately as the second and third arg respectively, or together as part of an options object.
Set the updateOn property for all controls in a form arrayThe options object is used to set a default value for each child
control's
Adding or removing controls from a form arrayTo change the controls in the array, use the |
| You are visitor 01402503 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |