FieldContextRegistryService
| Decorators: | @Injectable |
Service that provides field evaluation context by combining field context with root form registry information.
This service should be provided at the component level to ensure proper isolation between different form instances.
Methods
createDisplayOnlyContext() | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
Creates an evaluation context for display-only components (text fields, pages) that don't have their own FieldContext. This is useful for:
Uses reactive form value access to allow logic re-evaluation when form values change. | ||||||||||||
Presentation | ||||||||||||
Parameters
Returns |
createEvaluationContext() | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
Creates an evaluation context for a field by combining:
| ||||||||||||
Presentation | ||||||||||||
Parameters
Returns |
createReactiveEvaluationContext() | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
Creates a REACTIVE evaluation context for logic functions. Unlike createEvaluationContext, this method does NOT use untracked(), which allows logic functions (hidden, readonly, disabled, required) to create reactive dependencies on form values. When a dependent field value changes, the logic function will be re-evaluated. IMPORTANT: For this to work correctly, the form value signal should be registered with rootFormRegistry.registerFormValueSignal() BEFORE the form is created. This ensures the logic function can read form values during schema evaluation. NOTE: This should ONLY be used for logic functions, not validators. Validators should use createEvaluationContext with untracked() to prevent infinite reactive loops. Validators with cross-field dependencies should be hoisted to form-level using validateTree. | ||||||||||||
Presentation | ||||||||||||
Parameters
Returns |