# Class RxapFormBuilder<Data, Form>

#### Type Parameters

- Data extends Record<string, any> = any
- Form extends FormType<Data> = FormType<Data>

- Defined in packages/angular/forms/src/lib/form-builder.ts:67

#####
Index

### Constructors

constructor

### Properties

asyncValidators
controlChanges
controlSetValue
definition
formArrayControls
formArrayGroups
formControls
formGroups
formOptions
injector
providers
validators

### Methods

build
buildArrayControls
buildArrayGroups
buildControls
buildGroups
coerceToArrayFormState
coerceToControlFormState
coerceToFnArray
coerceToGroupFormState
coerceToValidatorArray
extractArrayControls
extractArrayGroups
extractAsyncValidators
extractControlChanges
extractControlSetValue
extractControls
extractFormOptions
extractGroups
extractValidators

## Constructors

### constructor

- new RxapFormBuilder<Data, Form>(definition, injector?, providers?): RxapFormBuilder<Data, Form>

- #### Type Parameters

  - Data extends Record<string, any> = any
  - Form extends FormType<Data> = FormType<Data>

  #### Parameters

  - definition: Constructor<Form>
  - injector: Injector = Injector.NULL
  - providers: StaticProvider[] = []

  #### Returns RxapFormBuilder<Data, Form>

  - Defined in packages/angular/forms/src/lib/form-builder.ts:89

## Properties

### `Private` `Readonly` asyncValidators

asyncValidators: Map<string, Set<string>>

- Defined in packages/angular/forms/src/lib/form-builder.ts:83

### `Private` `Readonly` controlChanges

controlChanges: Map<string, Set<string>>

- Defined in packages/angular/forms/src/lib/form-builder.ts:84

### `Private` `Readonly` controlSetValue

controlSetValue: Map<string, Set<ControlSetValueOptions>>

- Defined in packages/angular/forms/src/lib/form-builder.ts:85

### `Private` `Readonly` definition

definition: Constructor<Form>

- Defined in packages/angular/forms/src/lib/form-builder.ts:90

### `Private` `Readonly` formArrayControls

formArrayControls: Map<string, RxapAbstractControlOptions>

- Defined in packages/angular/forms/src/lib/form-builder.ts:75

### `Private` `Readonly` formArrayGroups

formArrayGroups: Map<string, RxapAbstractControlOptionsWithDefinition>

- Defined in packages/angular/forms/src/lib/form-builder.ts:71

### `Private` `Readonly` formControls

formControls: Map<string, RxapAbstractControlOptions>

- Defined in packages/angular/forms/src/lib/form-builder.ts:76

### `Private` `Readonly` formGroups

formGroups: Map<string, RxapAbstractControlOptionsWithDefinition>

- Defined in packages/angular/forms/src/lib/form-builder.ts:77

### `Private` `Readonly` formOptions

formOptions: FormDefinitionMetadata

- Defined in packages/angular/forms/src/lib/form-builder.ts:81

### `Private` `Readonly` injector

injector: Injector = Injector.NULL

- Defined in packages/angular/forms/src/lib/form-builder.ts:91

### `Private` `Readonly` providers

providers: StaticProvider[]

- Defined in packages/angular/forms/src/lib/form-builder.ts:87

### `Private` `Readonly` validators

validators: Map<string, Set<string>>

- Defined in packages/angular/forms/src/lib/form-builder.ts:82

## Methods

### build

- build<T>(state?, options?): T

- #### Type Parameters

  - T extends FormType<Data> | FormDefinition<Data, any, any>

  #### Parameters

  - state: Readonly<any> = {}
  - options: Partial<FormDefinitionMetadata & {
    controlId?: string;
    }> = {}

  #### Returns T

  - Defined in packages/angular/forms/src/lib/form-builder.ts:118

### `Private` buildArrayControls

- buildArrayControls(builderFormState, form, controls): void

- #### Parameters

  - builderFormState: any
  - form: FormDefinition<any, any, any> & Record<string, Function>
  - controls: Record<string, AbstractControl<any, any>>

  #### Returns void

  - Defined in packages/angular/forms/src/lib/form-builder.ts:193

### `Private` buildArrayGroups

- buildArrayGroups(builderFormState, form, controls): void

- #### Parameters

  - builderFormState: any
  - form: FormDefinition<any, any, any> & Record<string, Function>
  - controls: Record<string, AbstractControl<any, any>>

  #### Returns void

  - Defined in packages/angular/forms/src/lib/form-builder.ts:255

### `Private` buildControls

- buildControls(builderFormState, form, controls): void

- #### Parameters

  - builderFormState: any
  - form: Record<string, Function>
  - controls: Record<string, AbstractControl<any, any>>

  #### Returns void

  - Defined in packages/angular/forms/src/lib/form-builder.ts:377

### `Private` buildGroups

- buildGroups(builderFormState, form, controls): void

- #### Parameters

  - builderFormState: any
  - form: Record<string, Function>
  - controls: Record<string, AbstractControl<any, any>>

  #### Returns void

  - Defined in packages/angular/forms/src/lib/form-builder.ts:324

### `Private` coerceToArrayFormState

- coerceToArrayFormState(controlId, defaultFormState, builderFormState, optionsFormState?): any[]

- Coerce to the form state for the specified controlId. If none form state is found the default form state will be returned.

  The difference to the method coerceToControlFormState is that null will be handled as undefined and the defaultFormState is used

  #### Parameters

  - controlId: string

    A control id

  - defaultFormState: any[] | (() => any[])

    The default form state

  - builderFormState: Record<string, any>

    The form state provides as build state parameter

  - `Optional` optionsFormState: any

    The form state set by the decorator in the form definition

  #### Returns any[]

  - Defined in packages/angular/forms/src/lib/form-builder.ts:603

### `Private` coerceToControlFormState

- coerceToControlFormState(controlId, defaultFormState, builderFormState, optionsFormState?): any

- Coerce to the form state for the specified controlId. If none form state is found the default form state will be returned.

  #### Parameters

  - controlId: string

    A control id

  - defaultFormState: any

    The default form state

  - builderFormState: Record<string, any>

    The form state provides as build state parameter

  - `Optional` optionsFormState: any

    The form state set by the decorator in the form definition

  #### Returns any

  - Defined in packages/angular/forms/src/lib/form-builder.ts:531

### `Private` coerceToFnArray

- coerceToFnArray<T>(form, methodKeys?): T[]

- Coerce to a function array.

  #### Type Parameters

  - T extends Function

  #### Parameters

  - form: Record<string, Function>

    the current form definition instance

  - `Optional` methodKeys: Iterable<string | {
    propertyKey: string;
    }>

    A set of propertyKeys that points to form definition instance methods

  #### Returns T[]

  - Defined in packages/angular/forms/src/lib/form-builder.ts:468

### `Private` coerceToGroupFormState

- coerceToGroupFormState(controlId, defaultFormState, builderFormState, optionsFormState?): any

- Coerce to the form state for the specified controlId. If none form state is found the default form state will be returned.

  The difference to the method coerceToControlFormState is that null will be handled as undefined and the defaultFormState is used

  #### Parameters

  - controlId: string

    A control id

  - defaultFormState: any

    The default form state

  - builderFormState: Record<string, any>

    The form state provides as build state parameter

  - `Optional` optionsFormState: any

    The form state set by the decorator in the form definition

  #### Returns any

  - Defined in packages/angular/forms/src/lib/form-builder.ts:564

### `Private` coerceToValidatorArray

- coerceToValidatorArray<VF>(form, optionsValidators?, validatorMethodKeys?, injectValidators?): VF[]

- Coerce to a validator function array.

  #### Type Parameters

  - VF extends ValidatorFn | AsyncValidatorFn

  #### Parameters

  - form: Record<string, Function>

    the current form definition instance

  - `Optional` optionsValidators: VF | VF[]

    The options validator functions

  - `Optional` validatorMethodKeys: Set<string>

    A set of propertyKeys that points to form definition instance methods

  - `Optional` injectValidators: VF[]

    Injected validator functions

  #### Returns VF[]

  - Defined in packages/angular/forms/src/lib/form-builder.ts:497

### `Private` extractArrayControls

- extractArrayControls(): Map<string, RxapAbstractControlOptions>

- #### Returns Map<string, RxapAbstractControlOptions>

  - Defined in packages/angular/forms/src/lib/form-builder.ts:670

### `Private` extractArrayGroups

- extractArrayGroups(): Map<string, RxapAbstractControlOptionsWithDefinition>

- #### Returns Map<string, RxapAbstractControlOptionsWithDefinition>

  - Defined in packages/angular/forms/src/lib/form-builder.ts:660

### `Private` extractAsyncValidators

- extractAsyncValidators(): Map<string, Set<string>>

- #### Returns Map<string, Set<string>>

  - Defined in packages/angular/forms/src/lib/form-builder.ts:651

### `Private` extractControlChanges

- extractControlChanges(): Map<string, Set<string>>

- #### Returns Map<string, Set<string>>

  - Defined in packages/angular/forms/src/lib/form-builder.ts:630

### `Private` extractControlSetValue

- extractControlSetValue(): Map<string, Set<ControlSetValueOptions>>

- #### Returns Map<string, Set<ControlSetValueOptions>>

  - Defined in packages/angular/forms/src/lib/form-builder.ts:637

### `Private` extractControls

- extractControls(): Map<string, RxapAbstractControlOptions>

- #### Returns Map<string, RxapAbstractControlOptions>

  - Defined in packages/angular/forms/src/lib/form-builder.ts:689

### `Private` extractFormOptions

- extractFormOptions(): FormDefinitionMetadata

- #### Returns FormDefinitionMetadata

  - Defined in packages/angular/forms/src/lib/form-builder.ts:696

### `Private` extractGroups

- extractGroups(): Map<string, RxapAbstractControlOptionsWithDefinition>

- #### Returns Map<string, RxapAbstractControlOptionsWithDefinition>

  - Defined in packages/angular/forms/src/lib/form-builder.ts:679

### `Private` extractValidators

- extractValidators(): Map<string, Set<string>>

- #### Returns Map<string, Set<string>>

  - Defined in packages/angular/forms/src/lib/form-builder.ts:644