mirror of
https://github.com/angular/angular
synced 2026-05-24 09:28:37 +00:00
Previously, the following code would fail to compile:
```
let form: FormGroup<{email: FormControl<string | null>}>;
form = fb.group({
email: ['', Validators.required]
});
```
This is because the compiler was unable to properly infer the inner type of `ControlConfig` arrays in some cases. The same issue applies to `FormArray` as well under certain circumstances.
This change cleans up the `FormBuilder` type signatures to always use the explicit Element type, and to catch `ControlConfig` types that might fall through.
PR Close #45684
|
||
|---|---|---|
| .. | ||
| BUILD.bazel | ||
| directives_spec.ts | ||
| form_array_spec.ts | ||
| form_builder_spec.ts | ||
| form_control_spec.ts | ||
| form_group_spec.ts | ||
| reactive_integration_spec.ts | ||
| template_integration_spec.ts | ||
| typed_integration_spec.ts | ||
| util.ts | ||
| validators_spec.ts | ||
| value_accessor_integration_spec.ts | ||