withValidationExecutionDefaults
@ng-forge/dynamic-forms
Configures global validation execution defaults — when validators should run relative to a field's reactive state.
By default, validators are skipped for hidden fields (validateWhenHidden: false),
matching what most users expect: a hidden field is inert. Use this feature to
restore the legacy behavior where hidden fields still validate.
Remarks
Precedence rules:
1. Per-field FieldDef.validateWhenHidden — wins for that field; inherits down to descendants
that don't override.
2. Per-form FormOptions.validateWhenHidden — root inherited value for the form.
3. Global — fallback when no form/field setting.
4. No feature configured — uses token default (withValidationExecutionDefaults()validateWhenHidden: false).
Signature
function withValidationExecutionDefaults(config?: Partial<ValidationExecutionConfig> | undefined): DynamicFormFeature<"validation-execution">Parameters
| Name | Type | Description |
|---|---|---|
config? | Partial<ValidationExecutionConfig> | undefined | - Partial override. Unspecified properties keep their defaults. |
Returns
DynamicFormFeature<"validation-execution">
Examples
provideDynamicForm(...withMaterialFields())
// hidden fields skip validationprovideDynamicForm(
...withMaterialFields(),
withValidationExecutionDefaults({ validateWhenHidden: true })
)packages/dynamic-forms/src/lib/providers/features/validation-execution/with-validation-execution-defaults.ts:40