angular/packages/core/schematics
Dylan Hunn 89d299105a feat(forms): Implement strict types for the Angular Forms package. (#43834)
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
2022-04-12 17:37:04 +00:00
..
migrations feat(migrations): Add migration to add explicit Route/Routes type (#45084) 2022-04-04 14:53:45 -07:00
test feat(migrations): Add migration to add explicit Route/Routes type (#45084) 2022-04-04 14:53:45 -07:00
utils feat(core): drop support for TypeScript 4.4 and 4.5 (#45394) 2022-03-24 10:51:47 -07:00
BUILD.bazel feat(migrations): Add migration to add explicit Route/Routes type (#45084) 2022-04-04 14:53:45 -07:00
migrations.json feat(forms): Implement strict types for the Angular Forms package. (#43834) 2022-04-12 17:37:04 +00:00
package.json refactor(migrations): ensure CommonJS migrations can be accessed (#43657) 2021-10-04 16:24:48 -07:00
tsconfig.json build: enable useUnknownInCatchVariables (#44679) 2022-02-01 18:17:29 +00:00