• Overview
@angular/forms

NonNullableFormBuilder

Class

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

  
    abstract class NonNullableFormBuilder {}
  
  

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

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