angular/aio/content/examples
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
..
accessibility refactor(docs-infra): use eslint in aio's example-lint script (#43218) 2021-12-15 12:28:46 -05:00
ajs-quick-reference refactor(docs-infra): add types to all the aio examples buttons (#44557) 2022-02-03 12:44:47 -08:00
angular-compiler-options build(docs-infra): update docs examples to Angular v13.0.0-rc.0 (#43880) 2021-10-29 13:10:25 -07:00
angular-linker-plugin docs: improve markdown (#45325) 2022-04-08 19:36:30 +00:00
animations test(animations): Fix flaky animations e2e test (#45196) 2022-02-24 13:15:31 -08:00
architecture refactor: replace deprecated String.prototype.substr() (#45397) 2022-03-24 11:48:09 -07:00
attribute-binding refactor(docs-infra): add types to all the aio examples buttons (#44557) 2022-02-03 12:44:47 -08:00
attribute-directives docs(docs-infra): improve the content of attribute directives (#44628) 2022-01-06 18:36:46 +00:00
binding-syntax refactor(docs-infra): add types to all the aio examples buttons (#44557) 2022-02-03 12:44:47 -08:00
bootstrapping docs: remove unused "docregions" (#40479) 2021-01-20 16:12:15 -08:00
built-in-directives refactor(docs-infra): add types to all the aio examples buttons (#44557) 2022-02-03 12:44:47 -08:00
built-in-template-functions test(docs-infra): disable the Selenium Promise Manager in docs examples e2e tests (#39818) 2020-11-24 14:56:14 -08:00
cli-builder/src docs: update CLI builder to be platform agnostic (#42371) 2021-06-01 10:13:02 -07:00
comparing-observables build(docs-infra): switch the example-e2e script to ESM (#42921) 2021-07-23 10:37:35 -07:00
component-interaction refactor(docs-infra): add types to all the aio examples buttons (#44557) 2022-02-03 12:44:47 -08:00
component-overview refactor(docs-infra): use eslint in aio's example-lint script (#43218) 2021-12-15 12:28:46 -05:00
component-styles refactor(docs-infra): add types to all the aio examples buttons (#44557) 2022-02-03 12:44:47 -08:00
content-projection refactor(docs-infra): add types to all the aio examples buttons (#44557) 2022-02-03 12:44:47 -08:00
dependency-injection refactor(docs-infra): add types to all the aio examples buttons (#44557) 2022-02-03 12:44:47 -08:00
dependency-injection-in-action refactor(docs-infra): add types to all the aio examples buttons (#44557) 2022-02-03 12:44:47 -08:00
deprecation-guide refactor(docs-infra): use eslint in aio's example-lint script (#43218) 2021-12-15 12:28:46 -05:00
displaying-data docs: remove unused "docregions" (#40479) 2021-01-20 16:12:15 -08:00
docs-style-guide fix(docs-infra): removed duplicated style in aio examples (#45157) 2022-02-22 15:35:16 -08:00
dynamic-component-loader docs: solve the problem with Dynamic Component guide example (#45123) 2022-02-18 13:33:15 -08:00
dynamic-form refactor(docs-infra): use eslint in aio's example-lint script (#43218) 2021-12-15 12:28:46 -05:00
elements refactor(docs-infra): add types to all the aio examples buttons (#44557) 2022-02-03 12:44:47 -08:00
errors/cyclic-imports refactor(compiler-cli): error on cyclic imports in partial compilation (#40782) 2021-02-17 06:53:38 -08:00
event-binding refactor(docs-infra): add types to all the aio examples buttons (#44557) 2022-02-03 12:44:47 -08:00
feature-modules docs: remove unused "docregions" (#40479) 2021-01-20 16:12:15 -08:00
form-validation refactor(docs-infra): add types to all the aio examples buttons (#44557) 2022-02-03 12:44:47 -08:00
forms refactor(docs-infra): add types to all the aio examples buttons (#44557) 2022-02-03 12:44:47 -08:00
forms-overview build(docs-infra): update docs examples to Angular v12.1.3 (#42949) 2021-08-09 09:41:00 -07:00
getting-started refactor(docs-infra): add types to all the aio examples buttons (#44557) 2022-02-03 12:44:47 -08:00
getting-started-v0 docs: add missing Product interface to example (#42147) 2021-05-21 22:14:47 +00:00
hierarchical-dependency-injection refactor(docs-infra): add types to all the aio examples buttons (#44557) 2022-02-03 12:44:47 -08:00
http docs: improve structure of http example (#44986) 2022-02-28 19:31:25 +00:00
i18n build(docs-infra): remove defaultProject workspace option (#45410) 2022-03-24 10:49:57 -07:00
inputs-outputs refactor(docs-infra): add types to all the aio examples buttons (#44557) 2022-02-03 12:44:47 -08:00
interpolation refactor(docs-infra): fix template eslint issues in aio examples (#44557) 2022-02-03 12:44:46 -08:00
lazy-loading-ngmodules refactor(docs-infra): add types to all the aio examples buttons (#44557) 2022-02-03 12:44:47 -08:00
lifecycle-hooks refactor(docs-infra): add types to all the aio examples buttons (#44557) 2022-02-03 12:44:47 -08:00
ngcontainer refactor(docs-infra): add types to all the aio examples buttons (#44557) 2022-02-03 12:44:47 -08:00
ngmodules feat(forms): Implement strict types for the Angular Forms package. (#43834) 2022-04-12 17:37:04 +00:00
observables docs(docs-infra): change deprecated keyboardEvent.keyCode example to use keyboardEvent.code (#43934) 2021-10-26 00:05:22 +00:00
observables-in-angular refactor(docs-infra): add types to all the aio examples buttons (#44557) 2022-02-03 12:44:47 -08:00
pipes refactor(docs-infra): add types to all the aio examples buttons (#44557) 2022-02-03 12:44:47 -08:00
practical-observable-usage refactor(docs-infra): use eslint in aio's example-lint script (#43218) 2021-12-15 12:28:46 -05:00
property-binding refactor(docs-infra): add types to all the aio examples buttons (#44557) 2022-02-03 12:44:47 -08:00
providers docs: make all examples compatible with strict mode (#41999) 2021-05-17 10:42:18 -07:00
providers-viewproviders test(docs-infra): disable the Selenium Promise Manager in docs examples e2e tests (#39818) 2020-11-24 14:56:14 -08:00
reactive-forms docs(forms): remove type duplicate from button in reactive-forms example (#45124) 2022-02-18 13:34:59 -08:00
resolution-modifiers docs: make all examples compatible with strict mode (#41999) 2021-05-17 10:42:18 -07:00
router refactor: replace deprecated String.prototype.substr() (#45397) 2022-03-24 11:48:09 -07:00
router-tutorial docs: use shorthand background CSS property in Routing example (#40834) 2021-02-16 09:26:26 -08:00
routing-with-urlmatcher refactor: replace deprecated String.prototype.substr() (#45397) 2022-03-24 11:48:09 -07:00
rx-library docs: fix code sample indentation (#44517) 2022-01-04 12:15:55 -08:00
schematics-for-libraries build(docs-infra): remove defaultProject workspace option (#45410) 2022-03-24 10:49:57 -07:00
security docs: make all examples compatible with strict mode (#41999) 2021-05-17 10:42:18 -07:00
service-worker-getting-started docs: replace deprecated SwUpdate#available/activated with new API (#44858) 2022-02-18 13:40:34 -08:00
set-document-title refactor(docs-infra): add types to all the aio examples buttons (#44557) 2022-02-03 12:44:47 -08:00
setup refactor(docs-infra): use eslint in aio's example-lint script (#43218) 2021-12-15 12:28:46 -05:00
structural-directives docs: improve markdown (#45325) 2022-04-08 19:36:30 +00:00
styleguide fix(docs-infra): removed duplicated style in aio examples (#45157) 2022-02-22 15:35:16 -08:00
template-expression-operators docs: make all examples compatible with strict mode (#41999) 2021-05-17 10:42:18 -07:00
template-reference-variables refactor(docs-infra): add types to all the aio examples buttons (#44557) 2022-02-03 12:44:47 -08:00
template-syntax refactor(docs-infra): add types to all the aio examples buttons (#44557) 2022-02-03 12:44:47 -08:00
testing refactor: replace deprecated String.prototype.substr() (#45397) 2022-03-24 11:48:09 -07:00
toh-pt0 fix(docs-infra): fix tour of heroes global styles (#45329) 2022-03-15 13:24:52 -07:00
toh-pt1 refactor: replace deprecated String.prototype.substr() (#45397) 2022-03-24 11:48:09 -07:00
toh-pt2 refactor: replace deprecated String.prototype.substr() (#45397) 2022-03-24 11:48:09 -07:00
toh-pt3 refactor: replace deprecated String.prototype.substr() (#45397) 2022-03-24 11:48:09 -07:00
toh-pt4 refactor: replace deprecated String.prototype.substr() (#45397) 2022-03-24 11:48:09 -07:00
toh-pt5 refactor: replace deprecated String.prototype.substr() (#45397) 2022-03-24 11:48:09 -07:00
toh-pt6 refactor: replace deprecated String.prototype.substr() (#45397) 2022-03-24 11:48:09 -07:00
two-way-binding refactor(docs-infra): add types to all the aio examples buttons (#44557) 2022-02-03 12:44:47 -08:00
universal refactor: replace deprecated String.prototype.substr() (#45397) 2022-03-24 11:48:09 -07:00
upgrade-lazy-load-ajs refactor(docs-infra): fix eslint issues for aio ugrade-* examples (#44534) 2022-01-04 16:34:06 -08:00
upgrade-module refactor(docs-infra): add types to all the aio examples buttons (#44557) 2022-02-03 12:44:47 -08:00
upgrade-phonecat-1-typescript docs: improve markdown (#45325) 2022-04-08 19:36:30 +00:00
upgrade-phonecat-2-hybrid docs: improve markdown (#45325) 2022-04-08 19:36:30 +00:00
upgrade-phonecat-3-final docs: improve markdown (#45325) 2022-04-08 19:36:30 +00:00
user-input refactor(docs-infra): add types to all the aio examples buttons (#44557) 2022-02-03 12:44:47 -08:00
view-encapsulation refactor(docs-infra): use eslint in aio's example-lint script (#43218) 2021-12-15 12:28:46 -05:00
what-is-angular refactor(docs-infra): add types to all the aio examples buttons (#44557) 2022-02-03 12:44:47 -08:00
.eslintrc.json refactor(docs-infra): fix template eslint issues in aio examples (#44557) 2022-02-03 12:44:46 -08:00
.gitignore docs: move deprecations example snippets to external file (#43700) 2021-10-20 20:24:54 +00:00
tsconfig.eslint.json refactor(docs-infra): use eslint in aio's example-lint script (#43218) 2021-12-15 12:28:46 -05:00