Skip to content

feat(forms): add FieldState.getError()#67811

Merged
leonsenft merged 1 commit intoangular:mainfrom
alxhub:sf/get-error
Mar 24, 2026
Merged

feat(forms): add FieldState.getError()#67811
leonsenft merged 1 commit intoangular:mainfrom
alxhub:sf/get-error

Conversation

@alxhub
Copy link
Copy Markdown
Member

@alxhub alxhub commented Mar 23, 2026

Added a getError(kind: string) method to FieldState that returns the first validation error of a given kind, or undefined if no such error exists. This method is reactive and will re-evaluate when errors change.

Fixes #63905

Also updated public API goldens and added unit tests.

@pullapprove pullapprove bot requested review from AndrewKushnir and kirjs March 23, 2026 20:58
@alxhub alxhub added target: major This PR is targeted for the next major release forms: signals labels Mar 23, 2026
@angular-robot angular-robot bot added the detected: feature PR contains a feature commit label Mar 23, 2026
@alxhub alxhub added area: forms and removed detected: feature PR contains a feature commit labels Mar 23, 2026
@ngbot ngbot bot added this to the Backlog milestone Mar 23, 2026
Added a `getError(kind: string)` method to `FieldState` that returns the first validation error of a given kind, or `undefined` if no such error exists. This method is reactive and will re-evaluate when errors change.

Fixes angular#63905

Also updated public API goldens and added unit tests.
@angular-robot angular-robot bot added the detected: feature PR contains a feature commit label Mar 23, 2026
@AndrewKushnir AndrewKushnir removed their request for review March 23, 2026 22:30
@pullapprove pullapprove bot requested a review from AndrewKushnir March 23, 2026 22:30
Copy link
Copy Markdown
Contributor

@AndrewKushnir AndrewKushnir 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: public-api

@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 Mar 23, 2026
@alxhub
Copy link
Copy Markdown
Member Author

alxhub commented Mar 23, 2026

Caretaker: presubmit is "green"

@leonsenft leonsenft removed the request for review from kirjs March 24, 2026 22:07
@leonsenft leonsenft merged commit 709f5a3 into angular:main Mar 24, 2026
22 of 25 checks passed
@leonsenft
Copy link
Copy Markdown
Contributor

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

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 forms: signals 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

Status: Done

Development

Successfully merging this pull request may close these issues.

Consider adding hasError function for signal forms

3 participants