[ Web Proxy ]
URL:
Viewing: https://angular.dev/api/forms/NonNullableFormBuilder [Back]  [Original]

NonNullableFormBuilder Angular Skip to main content
menu
close
more_horiz
menuAPI
@angular/forms

NonNullableFormBuilder

Class
stable

NonNullableFormBuilder is similar to FormBuilder, but automatically constructed FormControl elements have {nonNullable: true} and are non-nullable.

FormBuilder and NonNullableFormBuilder

On this page

    arrow_upward_alt Back to the top

    API

        
          abstract class NonNullableFormBuilder {  abstract group<T extends {}>(controls: T, options?: AbstractControlOptions | null | undefined): FormGroup<NonNullableFormControls<T>>;  abstract record<T>(controls: { [key: string]: T; }, options?: AbstractControlOptions | null | undefined): FormRecord<Element<T, never>>;  abstract array<T>(controls: T[], validatorOrOpts?: ValidatorFn | AbstractControlOptions | ValidatorFn[] | null | undefined, asyncValidator?: AsyncValidatorFn | AsyncValidatorFn[] | null | undefined): FormArray<Element<T, never>>;  abstract control<T>(formState: T | FormControlState<T>, validatorOrOpts?: ValidatorFn | AbstractControlOptions | ValidatorFn[] | null | undefined, asyncValidator?: AsyncValidatorFn | AsyncValidatorFn[] | null | undefined): FormControl<T>;}
        
        

    group

    FormGroup<NonNullableFormControls<T>>

    Similar to FormBuilder#group, except any implicitly constructed FormControl will be non-nullable (i.e. it will have nonNullable set to true). Note that already-constructed controls will not be altered.

    @paramcontrolsT
    @paramoptionsAbstractControlOptions | null | undefined
    @returnsFormGroup<NonNullableFormControls<T>>

    record

    FormRecord<Element<T, never>>

    Similar to FormBuilder#record, except any implicitly constructed FormControl will be non-nullable (i.e. it will have nonNullable set to true). Note that already-constructed controls will not be altered.

    @paramcontrols{ [key: string]: T; }
    @paramoptionsAbstractControlOptions | null | undefined
    @returnsFormRecord<Element<T, never>>

    array

    FormArray<Element<T, never>>

    Similar to FormBuilder#array, except any implicitly constructed FormControl will be non-nullable (i.e. it will have nonNullable set to true). Note that already-constructed controls will not be altered.

    @paramcontrolsT[]
    @paramvalidatorOrOptsValidatorFn | AbstractControlOptions | ValidatorFn[] | null | undefined
    @paramasyncValidatorAsyncValidatorFn | AsyncValidatorFn[] | null | undefined
    @returnsFormArray<Element<T, never>>

    control

    FormControl<T>

    Similar to FormBuilder#control, except this overridden version of control forces nonNullable to be true, resulting in the control always being non-nullable.

    @paramformStateT | FormControlState<T>
    @paramvalidatorOrOptsValidatorFn | AbstractControlOptions | ValidatorFn[] | null | undefined
    @paramasyncValidatorAsyncValidatorFn | AsyncValidatorFn[] | null | undefined
    @returnsFormControl<T>
    Jump to details

    Web Proxy Viewer  |  New URL  |  Original Page