angular/packages/forms/src/directives
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
..
reactive_directives fix(forms): clean up connection between FormControl/FormGroup and corresponding directive instances (#39235) 2021-01-05 11:15:08 -08:00
abstract_control_directive.ts fix(forms): more precise control cleanup (#39623) 2020-11-12 09:38:19 -08:00
abstract_form_group_directive.ts refactor(forms): move common validators-related logic to the AbstractControlDirective class (#38280) 2020-10-28 09:48:20 -07:00
checkbox_value_accessor.ts docs(forms): exclude internal-only methods and properties from docs (#38583) 2020-08-27 16:39:38 -07:00
control_container.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
control_value_accessor.ts fix(forms): type NG_VALUE_ACCESSOR injection token as array (#29723) 2020-09-21 12:26:07 -07:00
default_value_accessor.ts docs: improve DefaultValueAccessor directive docs (#39404) 2020-10-26 10:50:41 -07:00
error_examples.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
form_interface.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
ng_control.ts refactor(forms): move common validators-related logic to the AbstractControlDirective class (#38280) 2020-10-28 09:48:20 -07:00
ng_control_status.ts fix(forms): handle standalone <form> tag correctly in NgControlStatusGroup directive (#40344) 2021-01-08 09:44:42 -08:00
ng_form.ts fix(forms): more precise control cleanup (#39623) 2020-11-12 09:38:19 -08:00
ng_model.ts docs(forms): update ngModel documentation (#39481) 2020-10-29 11:18:54 -07:00
ng_model_group.ts refactor(forms): move common validators-related logic to the AbstractControlDirective class (#38280) 2020-10-28 09:48:20 -07:00
ng_no_validate_directive.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
number_value_accessor.ts docs(forms): exclude internal-only methods and properties from docs (#38583) 2020-08-27 16:39:38 -07:00
radio_control_value_accessor.ts docs(forms): exclude internal-only methods and properties from docs (#38583) 2020-08-27 16:39:38 -07:00
range_value_accessor.ts docs(forms): exclude internal-only methods and properties from docs (#38583) 2020-08-27 16:39:38 -07:00
reactive_errors.ts perf(forms): use internal ngDevMode flag to tree-shake error messages in prod builds (#37821) 2020-08-24 09:26:28 -07:00
select_control_value_accessor.ts docs(forms): exclude internal-only methods and properties from docs (#38583) 2020-08-27 16:39:38 -07:00
select_multiple_control_value_accessor.ts docs(forms): exclude internal-only methods and properties from docs (#38583) 2020-08-27 16:39:38 -07:00
shared.ts fix(forms): clean up connection between FormControl/FormGroup and corresponding directive instances (#39235) 2021-01-05 11:15:08 -08:00
template_driven_errors.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
validators.ts docs(forms): exclude internal-only methods and properties from docs (#38583) 2020-08-27 16:39:38 -07:00