feat(Forms) Expose FormControl errors to parent FormGroup
**I'm submitting a ...** (check one with "x") ``` [ ] bug report [x feature request [ ] support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question ``` **Current behavior** When there are errors in a form group, the formGroup.status is 'INVALID' but the formGroup.errors property is null. ex. ``` formGroup.controls.username.errors: {invalidEmail: true} formGroup.errors: null ``` **Expected/desired behavior** When the validity of a FormControl changes, have the parent FormGroup.errors merged with the errors from the controls. This is similar to how the angularjs formController.$error property works. https://docs.angularjs.org/api/ng/type/form.FormController **What is the motivation / use case for changing the behavior?** This would be helpful because I prefer to only disable a submit button when specific errors are on a form, such as required. With this I could drive that attribute off the formControl.errors value instead of formControl.status. ex. ``` From: <button [disabled]="myForm.status !== 'VALID'">Submit</button> To: <button [disabled]="myForm.errors.required">Submit</button> ```
Posted by mhamel06 on Aug 5, 2016, 3:41 PM
Tags
Related issues
- Add 65536 size support for maps
- TypeScript 7.1 Iteration Plan
- nvim-treeconfig: upstream nvim-treesitter
- Add the "action" and "method" attributes to <button>
- [FEATURE] Support multiple Connector accounts (same connector, different accounts) in Claude and Claude Code on the web (claude.ai/code)
- > We were imposed GitHub for so many exercises!
Raise real-world problems, find people facing the same issue, and discuss solutions.5,000 issues0 comments
support (Software)
Add 65536 size support for maps
TypeScript 7.1 Iteration Plan
nvim-treeconfig: upstream nvim-treesitter
Add the "action" and "method" attributes to <button>
[FEATURE] Support multiple Connector accounts (same connector, different accounts) in Claude and Claude Code on the web (claude.ai/code)
> We were imposed GitHub for so many exercises!
Add support for Visual Studio 2026 Integration
Support for Helm v4
feat(Forms) Expose FormControl errors to parent FormGroup
**I'm submitting a ...** (check one with "x") ``` [ ] bug report [x feature request [ ] support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question ``` **Current behavior** When there are errors in a form group, the formGroup.status is 'INVALID' but the formGroup.errors property is null. ex. ``` formGroup.controls.username.errors: {invalidEmail: true} formGroup.errors: null ``` **Expected/desired behavior** When the validity of a FormControl changes, have the parent FormGroup.errors merged with the errors from the controls. This is similar to how the angularjs formController.$error property works. https://docs.angularjs.org/api/ng/type/form.FormController **What is the motivation / use case for changing the behavior?** This would be helpful because I prefer to only disable a submit button when specific errors are on a form, such as required. With this I could drive that attribute off the formControl.errors value instead of formControl.status. ex. ``` From: <button [disabled]="myForm.status !== 'VALID'">Submit</button> To: <button [disabled]="myForm.errors.required">Submit</button> ```
Comments (0)
No comments yet. Start the discussion.