angular/packages/forms/src/directives
Dylan Hunn 34ce635e3a feat(forms): undo revert and add ng-submitted class to forms that have been submitted. (#42132) (#42132)
As previously discussed in pull/31070 and issues/30486, this would be useful because it is often desirable to apply styles to fields that are both `ng-invalid` and `ng-pristine` after the first attempt at form submission, but Angular does not provide any simple way to do this (although evidently Angularjs did). This will now be possible with a descendant selector such as `.ng-submitted .ng-invalid`.

In this implementation, the directive that sets control status classes on forms and formGroups has its set of statuses widened to include `ng-submitted`. Then, in the event that `is('submitted')` is invoked, the `submitted` property of the control container is returned iff it exists. This is preferred over checking whether the container is a `Form` or `FormGroup` directly to avoid reflecting on those classes.

Closes #30486.

PR Close #42132.

This reverts commit 00b1444d12, undoing the rollback of this change.

PR Close #42132
2021-06-08 14:02:29 -07:00
..
reactive_directives fix(forms): registerOnValidatorChange should be called for ngModelGroup. (#41971) 2021-05-13 13:57:47 -04: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 refactor(forms): add base class for all built-in ControlValueAccessors (#41225) 2021-04-08 10:24:10 -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 ci: add lint error for files with missing trailing new-line (#42478) 2021-06-04 13:31:03 -07:00
default_value_accessor.ts refactor(forms): add base class for all built-in ControlValueAccessors (#41225) 2021-04-08 10:24:10 -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 feat(forms): undo revert and add ng-submitted class to forms that have been submitted. (#42132) (#42132) 2021-06-08 14:02:29 -07: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 refactor(forms): add base class for all built-in ControlValueAccessors (#41225) 2021-04-08 10:24:10 -07:00
radio_control_value_accessor.ts refactor(forms): add base class for all built-in ControlValueAccessors (#41225) 2021-04-08 10:24:10 -07:00
range_value_accessor.ts refactor(forms): add base class for all built-in ControlValueAccessors (#41225) 2021-04-08 10:24:10 -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 refactor(forms): add base class for all built-in ControlValueAccessors (#41225) 2021-04-08 10:24:10 -07:00
select_multiple_control_value_accessor.ts refactor(forms): add base class for all built-in ControlValueAccessors (#41225) 2021-04-08 10:24:10 -07:00
shared.ts fix(forms): registerOnValidatorChange should be called for ngModelGroup. (#41971) 2021-05-13 13:57:47 -04:00
template_driven_errors.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
validators.ts fix(forms): the min and max validators should work correctly with 0 as a value (#42412) 2021-06-03 11:34:46 -07:00