angular/packages/forms/src
Andrew Kushnir fdbd3cae8a fix(forms): handle standalone <form> tag correctly in NgControlStatusGroup directive (#40344)
The `NgControlStatusGroup` directive is shared between template-driven and reactive form modules. In cases when
only reactive forms module is present, the `NgControlStatusGroup` directive is still activated on all `<form>`
elements, but if there is no other reactive directive applied (such as `formGroup`), corresponding `ControlContainer`
token is missing, thus causing exceptions (since `NgControlStatusGroup` directive relies on it to determine the
status). This commit updates the logic to handle the case when no `ControlContainer` is present (effectively making
directive logic a noop in this case).

Alternative approach (more risky) worth considering in the future is to split the `NgControlStatusGroup` into
2 directives with different set of selectors and include them into template-driven and reactive modules separately.
The downside is that these directives might be activated simultaneously on the same element (e.g. `<form>`),
effectively doing the work twice.

Resolves #38391.

PR Close #40344
2021-01-08 09:44:42 -08:00
..
directives fix(forms): handle standalone <form> tag correctly in NgControlStatusGroup directive (#40344) 2021-01-08 09:44:42 -08:00
directives.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
form_builder.ts docs: improve FormBuilder.group deprecation message (#39946) 2020-12-04 10:18:48 -08: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 docs(forms): fix example 'Reset the form group values and disabled status' (#33137) 2020-12-02 11:14:25 -08:00
validators.ts docs(forms): typo word "property" was missing (#40323) 2021-01-06 08:44:03 -08:00
version.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00