angular/packages/forms/src
Dylan Hunn e49fc96ed3 feat(forms): Make Form Statuses use stricter types. (#42952)
Specifically: narrow the type used for form statuses from string to a union of possible statuses. Change the API methods from any to use the new type.

This is a breaking change. However, as discussed in the PR, breakage seems minimal, and google3 has been prepped to land this.

Background: we uncovered these any typings in the course of design work for typed forms. They could be fixed in a non-breaking manner by piggybacking them on top of the new typed forms generics, but it would be much cleaner to fix them separately if possible.

BREAKING CHANGE:

A new type called `FormControlStatus` has been introduced, which is a union of all possible status strings for form controls. `AbstractControl.status` has been narrowed from `string` to `FormControlStatus`, and `statusChanges` has been narrowed from `Observable<any>` to `Observable<FormControlStatus>`. Most applications should consume the new types seamlessly. Any breakage caused by this change is likely due to one of the following two problems: (1) the app is comparing `AbstractControl.status` against a string which is not a valid status; or, (2) the app is using `statusChanges` events as if they were something other than strings.

PR Close #42952
2021-08-04 16:28:20 -07:00
..
directives feat(forms): allow minLength/maxLength validator to be bound to null (#42565) 2021-07-21 22:35:59 +00:00
directives.ts perf(forms): make RadioControlRegistry class tree-shakable (#41126) 2021-03-16 09:35:14 -07:00
form_builder.ts perf(forms): make FormBuilder class tree-shakable (#41126) 2021-03-16 09:35:14 -07:00
form_providers.ts perf(forms): make RadioControlRegistry class tree-shakable (#41126) 2021-03-16 09:35:14 -07:00
forms.ts feat(forms): introduce min and max validators (#39063) 2021-02-08 09:34:50 -08:00
model.ts feat(forms): Make Form Statuses use stricter types. (#42952) 2021-08-04 16:28:20 -07:00
validators.ts feat(forms): add hasValidators, addValidators, and removeValidators methods (for both sync and async) (#42838) 2021-07-22 16:31:00 +00:00
version.ts docs: fix package name in version.ts files in different packages (#41208) 2021-05-10 10:26:34 -04:00