EvaluationContext
@ng-forge/dynamic-forms
Signature
interface EvaluationContext<
TValue = unknown,
TFormValue extends Record<string, unknown> = any
>Type Parameters
| Name | Constraint | Default | Description |
|---|---|---|---|
TValue | - | unknown | - |
TFormValue | Record<string, unknown> | any | - |
Properties
| Name | Type | Description |
|---|---|---|
fieldValue | TValue | Current field value |
formValue | TFormValue | Form value for the current evaluation scope. For regular (non-array) derivations, this contains the complete form value.
For array item derivations, this is scoped to the current array item.
Use |
fieldPath | string | Field path for relative references |
customFunctions ? | Record<string, (context: EvaluationContext<unknown, any>) => unknown> | Custom evaluation functions |
logger | Logger | Logger for diagnostic output |
groupValue ? | unknown | Value of the field's nearest parent group (or array item, when the field has no inner group above the array boundary). Complements Resolution at evaluation time:
- Inside a group at form root: the parent group's value object (e.g.,
for |
rootFormValue ? | Record<string, unknown> | Root form value when inside an array context. This provides access to values outside the current array item.
When a derivation targets an array item field (e.g., |
arrayIndex ? | number | Current array index when inside an array derivation. |
arrayPath ? | string | Path to the array field when inside an array derivation. |
externalData ? | Record<string, unknown> | External data signals resolved to their current values. This allows forms to reference data from outside the form context in conditional logic, derivations, and other expressions. |
deprecationTracker ? | WarningTracker | DI-scoped tracker for deprecation warnings. Used by the condition evaluator to deduplicate deprecation warnings. |
fieldState ? | FieldStateInfo | State of the current field being evaluated. Provides access to field state properties like |
formFieldState ? | FormFieldStateMap | State of all fields in the form, keyed by field key. Provides access to any field's state properties by key. Uses a Proxy for lazy evaluation — field state is only read when accessed. |
packages/dynamic-forms/src/lib/models/expressions/evaluation-context.ts:6