W3cubDocs

/Angular

UntypedFormBuilder

class final

UntypedFormBuilder is the same as FormBuilder, but it provides untyped controls.

class UntypedFormBuilder extends FormBuilder {
  group(controlsConfig: { [key: string]: any; }, options: AbstractControlOptions | { [key: string]: any; } = null): UntypedFormGroup
  control(formState: any, validatorOrOpts?: ValidatorFn | FormControlOptions | ValidatorFn[], asyncValidator?: AsyncValidatorFn | AsyncValidatorFn[]): UntypedFormControl
  array(controlsConfig: any[], validatorOrOpts?: ValidatorFn | AbstractControlOptions | ValidatorFn[], asyncValidator?: AsyncValidatorFn | AsyncValidatorFn[]): UntypedFormArray

  // inherited from forms/FormBuilder
  nonNullable: NonNullableFormBuilder
  group(controls: { [key: string]: any; }, options: AbstractControlOptions | { [key: string]: any; } = null): FormGroup
  record<T>(controls: { [key: string]: T; }, options: AbstractControlOptions = null): FormRecord<ɵElement<T, null>>
  control<T>(formState: T | FormControlState<T>, validatorOrOpts?: ValidatorFn | FormControlOptions | ValidatorFn[], asyncValidator?: AsyncValidatorFn | AsyncValidatorFn[]): FormControl
  array<T>(controls: T[], validatorOrOpts?: ValidatorFn | AbstractControlOptions | ValidatorFn[], asyncValidator?: AsyncValidatorFn | AsyncValidatorFn[]): FormArray<ɵElement<T, null>>
}

Provided in

  • 'root'

Methods

Like FormBuilder#group, except the resulting group is untyped.

group(controlsConfig: { [key: string]: any; }, options?: AbstractControlOptions): UntypedFormGroup

Parameters
controlsConfig object
options AbstractControlOptions

Optional. Default is undefined.

Returns

UntypedFormGroup

group(controlsConfig: { [key: string]: any; }, options: { [key: string]: any; }): UntypedFormGroup

Deprecated This API is not typesafe and can result in issues with Closure Compiler renaming. Use the FormBuilder#group overload with AbstractControlOptions instead.

Parameters
controlsConfig object
options object
Returns

UntypedFormGroup

Like FormBuilder#control, except the resulting control is untyped.

control(formState: any, validatorOrOpts?: ValidatorFn | FormControlOptions | ValidatorFn[], asyncValidator?: AsyncValidatorFn | AsyncValidatorFn[]): UntypedFormControl

Parameters
formState any
validatorOrOpts ValidatorFn | FormControlOptions | ValidatorFn[]

Optional. Default is undefined.

asyncValidator AsyncValidatorFn | AsyncValidatorFn[]

Optional. Default is undefined.

Returns

UntypedFormControl

Like FormBuilder#array, except the resulting array is untyped.

array(controlsConfig: any[], validatorOrOpts?: ValidatorFn | AbstractControlOptions | ValidatorFn[], asyncValidator?: AsyncValidatorFn | AsyncValidatorFn[]): UntypedFormArray

Parameters
controlsConfig any[]
validatorOrOpts ValidatorFn | AbstractControlOptions | ValidatorFn[]

Optional. Default is undefined.

asyncValidator AsyncValidatorFn | AsyncValidatorFn[]

Optional. Default is undefined.

Returns

UntypedFormArray

© 2010–2023 Google, Inc.
Licensed under the Creative Commons Attribution License 4.0.
https://angular.io/api/forms/UntypedFormBuilder