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 — FormControl • Angular The default value of this FormControl, used whenever the control is reset without an explicit
value. See Sets a new value for the form control. @paramvalue TValueThe new value for the control. @paramoptions { onlySelf?: boolean | undefined; emitEvent?: boolean | undefined; emitModelToViewChange?: boolean | undefined; emitViewToModelChange?: boolean | undefined; } | undefinedConfiguration options that determine how the control propagates changes
and emits events when the value changes.
The configuration options are passed to the
@returns voidPatches the value of a control. This function is functionally the same as @paramvalue TValue@paramoptions { onlySelf?: boolean | undefined; emitEvent?: boolean | undefined; emitModelToViewChange?: boolean | undefined; emitViewToModelChange?: boolean | undefined; } | undefined@returns voidResets the form control, marking it
@paramformState TValue | FormControlState<TValue> | undefinedResets the control with an initial value, or an object that defines the initial value and disabled state. @paramoptions { onlySelf?: boolean | undefined; emitEvent?: boolean | undefined; overwriteDefaultValue?: boolean | undefined; } | undefinedConfiguration options that determine how the control propagates changes and emits events after the value changes.
@returns voidFor a simple FormControl, the raw value is equivalent to the value. @returns TValueRegister a listener for change events. @paramfn FunctionThe method that is called when the value changes @returns voidRegister a listener for disabled events. @paramfn (isDisabled: boolean) => voidThe method that is called when the disabled status changes. @returns voidThe 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 validation status of an individual form control. This is one of the four fundamental building blocks of Angular forms, along with
See usage examples below. Usage NotesInitializing Form ControlsInstantiate a
The following example initializes the control with a form state object. The
The following example initializes the control with a synchronous validator.
The following example initializes the control using an options object.
The single type argument
If you are initializing the control to
You might notice that Configure the control to update on a blur eventSet the
Configure the control to update on a submit eventSet the
Reset the control back to a specific valueYou reset to a specific form state by passing through a standalone value or a form state object that contains both a value and a disabled state (these are the only two properties that cannot be calculated).
Reset the control to its initial valueIf you wish to always reset the control to its initial value (instead of null),
you can pass the
Reset the control back to an initial value and disabled
|
| 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. |