Interface

FormOptions

@ng-forge/dynamic-forms

Global form configuration options.

Controls form-wide behavior including disabled state and button behavior configuration.

Signature

interface FormOptions

Properties

NameTypeDescription
disabled ?boolean | undefined

Disable the entire form.

When enabled, all form fields become read-only and cannot be modified by user interaction.

@value false

maxDerivationIterations ?number | undefined

Maximum number of iterations for derivation chain processing.

Derivations can trigger other derivations (e.g., A → B → C). This limit prevents infinite loops in case of circular dependencies that weren't caught at build time.

Increase this value if you have legitimate deep derivation chains (more than 10 levels deep).

submitButton ?SubmitButtonOptions | undefined

Default disabled behavior for submit buttons.

Controls when submit buttons are automatically disabled. Can be overridden per-button via the logic array on individual button fields.

nextButton ?NextButtonOptions | undefined

Default disabled behavior for next page buttons.

Controls when next page buttons are automatically disabled in paged forms. Can be overridden per-button via the logic array on individual button fields.

excludeValueIfHidden ?boolean | undefined

Whether to exclude values of hidden fields from submission output.

Overrides the global withValueExclusionDefaults() setting for this form. Can be further overridden per-field on individual FieldDef entries.

excludeValueIfDisabled ?boolean | undefined

Whether to exclude values of disabled fields from submission output.

Overrides the global withValueExclusionDefaults() setting for this form. Can be further overridden per-field on individual FieldDef entries.

excludeValueIfReadonly ?boolean | undefined

Whether to exclude values of readonly fields from submission output.

Overrides the global withValueExclusionDefaults() setting for this form. Can be further overridden per-field on individual FieldDef entries.

validateWhenHidden ?boolean | undefined

Whether to run validation when a field is hidden.

Acts as the root inherited value for the entire form — per-field FieldDef.validateWhenHidden overrides it for a subtree, and once overridden the new value is itself inherited by descendants unless they override in turn.

Overrides the global withValidationExecutionDefaults() setting for this form.

emitFormValueOnEvents ?boolean | undefined

Whether to attach the current form value to all events dispatched through the EventBus.

This per-form setting overrides the global withEventFormValue() feature: - true - Enable form value emission for this form (even if globally disabled) - false - Disable form value emission for this form (even if globally enabled) - undefined - Use global setting (default)

When enabled, events will include a formValue property with the current form state. Use the hasFormValue() type guard to safely access this property.

Examples

options: {
  disabled: false,
  submitButton: { disableWhenInvalid: true }
}