Skip to content

feat(forms): add error summaries to fields #63067

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: prototype/signal-forms
Choose a base branch
from

Conversation

leonsenft
Copy link
Contributor

Add an errorSummary signal to FieldState which contains all of the validation errors of a field and its descendants. This can be used to conveniently collect all form validation errors by reading it from the root field.

@pullapprove pullapprove bot requested a review from kirjs August 8, 2025 16:30
@angular-robot angular-robot bot added detected: feature PR contains a feature commit area: forms target: feature This PR is targeted for a feature branch (outside of main and semver branches) labels Aug 8, 2025
@ngbot ngbot bot added this to the Backlog milestone Aug 8, 2025
@leonsenft leonsenft requested a review from mmalerba August 8, 2025 16:30
@leonsenft leonsenft force-pushed the error-summary branch 2 times, most recently from 3d9a897 to f8b2dd0 Compare August 9, 2025 00:12
Add an `errorSummary` signal to `FieldState` which contains all of the
validation errors of a field and its descendants. This can be used to
conveniently collect all form validation errors by reading it from the
root field.
@@ -109,6 +110,12 @@ export class FieldNode implements FieldState<unknown> {
return this.validationState.errors;
}

get errorSummary(): Signal<ValidationError[]> {
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we want the WithField variety right? Otherwise I don't know which error belongs to which field.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: forms detected: feature PR contains a feature commit target: feature This PR is targeted for a feature branch (outside of main and semver branches)
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

2 participants