fix(forms): _reduceValue arrow function now has correct types. (#44483)

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
This commit is contained in:
Dylan Hunn
2021-12-14 15:54:48 -08:00
committed by Alex Rickabaugh
parent 72092ebd26
commit 6a0dadf46f
+1 -1
View File
@@ -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;
}