Skip to content

Commit

Permalink
fix(forms): _reduceValue arrow function now has correct types. (#44483
Browse files Browse the repository at this point in the history
)

I previously strengthened some weak types in #44370. One of these fixes exposed an incorrect call into `_reduceChildren` from `_reduceValue`. This was caught in google3 by a caller who was extending `FormGroup` and overriding these methods.

Special thanks to Bart G for catching this issue and suggesting a fix.

PR Close #44483
  • Loading branch information
dylhunn authored and alxhub committed Dec 15, 2021
1 parent 72092eb commit 6a0dadf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/forms/src/model.ts
Expand Up @@ -1914,7 +1914,7 @@ export class FormGroup extends AbstractControl {
/** @internal */
_reduceValue() {
return this._reduceChildren(
{}, (acc: {[k: string]: AbstractControl}, control: AbstractControl, name: string) => {
{}, (acc: {[k: string]: any}, control: AbstractControl, name: string): any => {
if (control.enabled || this.disabled) {
acc[name] = control.value;
}
Expand Down

0 comments on commit 6a0dadf

Please sign in to comment.