angular-cn/packages/forms/src
lazarljubenovic f4f1bcc997 fix(forms): include null in .parent of abstract control (#32671)
It's perfectly valid for an abstract control not to have a defined parent; yet previously the
types were asserting that AbstractControl#parent is not a null value. This changes correctly
reflects the run-time behavior through the types.

BREAKING CHANGE: Type of AbstractFormControl.parent now includes null

`null` is now included in the types of .parent. If you don't already have a check for this case,
the TypeScript compiler might compain. A v11 migration exists which adds the not-null assertion
operator where necessary.

In an unlikely case your code was testing the parnet against undefined with sitrct equality,
you'll need to change this to `=== null` instead, since the parent is not explicily initialized
with `null` instead of being left `undefined`.

Fixes #16999

PR Close #32671
2020-10-05 09:30:44 -07:00
..
directives fix(forms): type NG_VALUE_ACCESSOR injection token as array (#29723) 2020-09-21 12:26:07 -07:00
directives.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
form_builder.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
form_providers.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
forms.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
model.ts fix(forms): include null in .parent of abstract control (#32671) 2020-10-05 09:30:44 -07:00
validators.ts perf(forms): use internal `ngDevMode` flag to tree-shake error messages in prod builds (#37821) 2020-08-24 09:26:28 -07:00
version.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00