angular-docs-cn/packages/forms/src
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
..
directives 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
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 docs(forms): add array example to get method (#41008) 2021-02-26 08:24:22 -08:00
validators.ts perf(forms): avoid direct references to the `Validators` class (#41189) 2021-03-15 11:12:55 -07:00
version.ts docs: fix package name in version.ts files in different packages (#41208) 2021-05-10 10:26:34 -04:00