Const
FORM_OPTIONS
@ng-forge/dynamic-forms
Injection token for form-level options.
Form options control form-wide behavior including button disabled states. Used by button mappers to determine default disabled behavior.
Like DEFAULT_PROPS, this token is provided ONCE at the DynamicForm level
and inherited by all children via Angular's hierarchical injector.
The token provides a Signal to enable reactivity - when config changes, mappers
that read the signal inside their computed() will automatically update.
Signature
const FORM_OPTIONS: InjectionToken<Signal<FormOptions>>Examples
// In a button mapper
const formOptionsSignal = inject(FORM_OPTIONS);
return computed(() => {
const formOptions = formOptionsSignal?.(); // Read inside computed for reactivity
const disableWhenInvalid = formOptions?.submitButton?.disableWhenInvalid ?? true;
// ...
});packages/dynamic-forms/src/lib/models/field-signal-context.token.ts:160