Skip to content

Support NG_VALIDATORS in CVA mode#67943

Closed
alxhub wants to merge 3 commits intoangular:mainfrom
alxhub:sf/ng-validators
Closed

Support NG_VALIDATORS in CVA mode#67943
alxhub wants to merge 3 commits intoangular:mainfrom
alxhub:sf/ng-validators

Conversation

@alxhub
Copy link
Copy Markdown
Member

@alxhub alxhub commented Mar 30, 2026

  • fix(forms): use controlValue in NgControl for CVA interop
  • feat(forms): shim legacy NG_VALIDATORS into parseErrors for CVA mode

@alxhub alxhub requested a review from leonsenft March 30, 2026 17:18
@angular-robot angular-robot bot added detected: feature PR contains a feature commit area: forms labels Mar 30, 2026
@ngbot ngbot bot added this to the Backlog milestone Mar 30, 2026
@alxhub alxhub force-pushed the sf/ng-validators branch from a40f3f4 to 8846a30 Compare March 30, 2026 17:30
@pullapprove pullapprove bot requested a review from AndrewKushnir March 30, 2026 17:30
@alxhub alxhub added the target: major This PR is targeted for the next major release label Mar 30, 2026
Comment thread packages/forms/signals/test/web/interop.spec.ts Outdated
Comment thread packages/forms/signals/test/web/interop.spec.ts Outdated
Comment thread packages/forms/signals/src/directive/form_field.ts Outdated
Comment thread packages/forms/signals/src/directive/form_field.ts Outdated
Comment thread packages/forms/signals/src/directive/control_cva.ts Outdated
Comment thread packages/forms/signals/test/web/interop.spec.ts Outdated
@alxhub alxhub requested a review from leonsenft April 2, 2026 23:26
@alxhub alxhub force-pushed the sf/ng-validators branch 2 times, most recently from 5753f71 to 81264dc Compare April 2, 2026 23:59
Copy link
Copy Markdown
Contributor

@leonsenft leonsenft left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reviewed-for: fw-general, public-api

alxhub added 3 commits April 8, 2026 11:21
use controlValue() instead of value() to ensure that CVA controls see the most recent user input immediately rather than waiting for it to be synchronized after debouncing
- Injected `NG_VALIDATORS` into `FormField` and exposed it via an internal getter.
- Created a `computed` signal in `cvaControlCreate` to run legacy validators and map into standard validation errors without generic `as any` type assertions.
- Intercepted `registerOnValidatorChange` to trigger updates even when the model value remains unchanged (e.g., going from `null` to `null`).
- Added integration tests to verify parse error propagation and reactivity.
@alxhub alxhub force-pushed the sf/ng-validators branch from 81264dc to ca4a428 Compare April 8, 2026 18:27
@alxhub alxhub added action: merge The PR is ready for merge by the caretaker merge: caretaker note Alert the caretaker performing the merge to check the PR for an out of normal action needed or note labels Apr 14, 2026
@alxhub
Copy link
Copy Markdown
Member Author

alxhub commented Apr 14, 2026

Caretaker: g3 is "green"

@kirjs
Copy link
Copy Markdown
Contributor

kirjs commented Apr 14, 2026

This PR was merged into the repository. The changes were merged into the following branches:

@kirjs kirjs closed this in 72d3ace Apr 14, 2026
kirjs pushed a commit that referenced this pull request Apr 14, 2026
…67943)

- Injected `NG_VALIDATORS` into `FormField` and exposed it via an internal getter.
- Created a `computed` signal in `cvaControlCreate` to run legacy validators and map into standard validation errors without generic `as any` type assertions.
- Intercepted `registerOnValidatorChange` to trigger updates even when the model value remains unchanged (e.g., going from `null` to `null`).
- Added integration tests to verify parse error propagation and reactivity.

PR Close #67943
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

action: merge The PR is ready for merge by the caretaker area: forms detected: feature PR contains a feature commit merge: caretaker note Alert the caretaker performing the merge to check the PR for an out of normal action needed or note target: major This PR is targeted for the next major release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants