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
19 lines
No EOL
954 B
JSON
19 lines
No EOL
954 B
JSON
{
|
|
"schematics": {
|
|
"migration-entry-components": {
|
|
"version": "14.0.0-beta",
|
|
"description": "As of Angular version 13, `entryComponents` are no longer necessary.",
|
|
"factory": "./migrations/entry-components/index"
|
|
},
|
|
"migration-v14-typed-forms": {
|
|
"version": "14.0.0-beta",
|
|
"description": "As of Angular version 14, Forms model classes accept a type parameter, and existing usages must be opted out to preserve backwards-compatibility.",
|
|
"factory": "./migrations/typed-forms/index"
|
|
},
|
|
"migration-v14-path-match-type": {
|
|
"version": "14.0.0-beta",
|
|
"description": "In Angular version 14, the `pathMatch` property of `Routes` was updated to be a strict union of the two valid options: `'full'|'prefix'`. `Routes` and `Route` variables need an explicit type so TypeScript does not infer the property as the looser `string`.",
|
|
"factory": "./migrations/path-match-type/index"
|
|
}
|
|
}
|
|
} |