angular/aio/content
Dylan Hunn 47270d9e63 feat(forms): add ng-submitted class to forms that have been submitted. (#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
2021-06-03 13:21:29 -07:00
..
cli build(docs-infra): ensure that terminal code snippets render correctly (#41986) 2021-05-07 13:11:04 -04:00
cli-src build(docs-infra): make the git ref for cli command docs configurable (#26391) 2018-10-11 12:57:49 -07:00
errors docs: add error page for NG6999 (#41708) 2021-04-28 14:22:46 -07:00
examples docs: remove unused imports from unit tests (#42441) 2021-06-02 13:22:09 -07:00
guide feat(forms): add ng-submitted class to forms that have been submitted. (#42132) 2021-06-03 13:21:29 -07:00
images docs: offboard misko and annie from contributors page (#42467) 2021-06-03 13:17:45 -07:00
marketing docs: offboard misko and annie from contributors page (#42467) 2021-06-03 13:17:45 -07:00
start docs: fix a typo (#42384) 2021-05-27 08:55:28 -07:00
tutorial docs: edits to remove jargon (#42025) 2021-05-27 16:46:11 -07:00
file-not-found.md fix(docs-infra): increase the max width of the file-not-found page (#41275) 2021-04-01 11:36:44 -07:00
license.md docs: update year (#40925) 2021-02-22 12:37:40 -08:00
navigation.json docs: move the schematics under Angular Tools menu section (#42332) 2021-05-26 20:05:12 +00:00