angular/packages/forms/test
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
..
BUILD.bazel build: switch devmode output to es2015 (#44505) 2022-01-05 23:20:20 +00:00
directives_spec.ts fix(forms): improve error message for invalid value accessors (#45192) 2022-03-15 13:26:03 -07:00
form_array_spec.ts feat(forms): Implement strict types for the Angular Forms package. (#43834) 2022-04-12 17:37:04 +00:00
form_builder_spec.ts fix(forms): Make UntypedFormBuilder assignable to FormBuilder, and vice versa. (#45421) 2022-03-24 10:49:10 -07:00
form_control_spec.ts refactor(forms): Move FormControl to an overridden exported constructor. (#44316) (#44806) 2022-01-31 22:48:23 +00:00
form_group_spec.ts feat(forms): Implement strict types for the Angular Forms package. (#43834) 2022-04-12 17:37:04 +00:00
reactive_integration_spec.ts fix(forms): not picking up disabled state if group is swapped out and disabled (#43499) 2022-03-28 09:26:19 -07:00
template_integration_spec.ts feat(core): triggerEventHandler accept optional eventObj (#45279) 2022-03-09 13:51:54 -08:00
typed_integration_spec.ts feat(forms): Implement strict types for the Angular Forms package. (#43834) 2022-04-12 17:37:04 +00:00
util.ts refactor(forms): refactor common validators used in unit tests (#38020) 2020-07-22 20:42:43 -07:00
validators_spec.ts fix(forms): Correct empty validator to handle objects with a property length: 0. (#33729) 2022-02-03 23:15:27 -08:00
value_accessor_integration_spec.ts fix(forms): ensure OnPush ancestors are marked dirty when the promise resolves (#44886) 2022-01-31 21:38:39 +00:00