angular/packages/forms/test
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
..
BUILD.bazel test: disable failing saucelabs tests (#36620) 2020-04-14 10:13:33 -07:00
directives_spec.ts test: clean up internal testing utilities (#42177) 2021-05-26 20:07:25 +00:00
form_array_spec.ts test: clean up internal testing utilities (#42177) 2021-05-26 20:07:25 +00:00
form_builder_spec.ts test: clean up internal testing utilities (#42177) 2021-05-26 20:07:25 +00:00
form_control_spec.ts test: clean up internal testing utilities (#42177) 2021-05-26 20:07:25 +00:00
form_group_spec.ts test: clean up internal testing utilities (#42177) 2021-05-26 20:07:25 +00:00
reactive_integration_spec.ts feat(forms): add ng-submitted class to forms that have been submitted. (#42132) 2021-06-03 13:21:29 -07:00
template_integration_spec.ts feat(forms): add ng-submitted class to forms that have been submitted. (#42132) 2021-06-03 13:21:29 -07:00
util.ts refactor(forms): refactor common validators used in unit tests (#38020) 2020-07-22 20:42:43 -07:00
validators_spec.ts test: clean up internal testing utilities (#42177) 2021-05-26 20:07:25 +00:00
value_accessor_integration_spec.ts feat(core): update reference and doc to change async to waitAsync. (#37583) 2020-08-03 12:54:13 -07:00