mirror of
https://github.com/angular/angular
synced 2026-05-24 09:28:37 +00:00
This PR strongly types the forms package by adding generics to AbstractControl classes as well as FormBuilder. This makes forms type-safe and null-safe, for both controls and values. The design uses a "control-types" approach. In other words, the type parameter on FormGroup is an object containing controls, and the type parameter on FormArray is an array of controls. Special thanks to Alex Rickabaugh and Andrew Kushnir for co-design & implementation, to Sonu Kapoor and Netanel Basal for illustrative prior art, and to Cédric Exbrayat for extensive testing and validation. BREAKING CHANGE: Forms classes accept a generic. Forms model classes now accept a generic type parameter. Untyped versions of these classes are available to opt-out of the new, stricter behavior. PR Close #43834 |
||
|---|---|---|
| .. | ||
| benchmarks | ||
| playground | ||
| empty.ts | ||
| system.d.ts | ||
| tsconfig.json | ||
| types.d.ts | ||