42 Commits

Author SHA1 Message Date
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 00b1444d122a64a5b6772d694c838ce8b9ca7b7d, undoing the rollback of this change.

PR Close #42132
2021-06-08 14:02:29 -07:00
Jessica Janiuk
00b1444d12 Revert "feat(forms): add ng-submitted class to forms that have been submitted." (#42474)
This reverts commit f024d7556081f8913f21761bb8e6aab8d08be110.

PR Close #42474
2021-06-03 17:42:02 -07:00
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
Dylan Hunn
c54643f00e docs(forms): make the forms validation guide specify more clearly what happens when mixing HTML5 native validators with Angular forms. (#42377)
Previously, the docs didn't say anything about the fact that the `novalidate` attribute is added to the enclosing form, or how to override that behavior. I have added a couple lines in the appropriate spot clarifying this issue.

PR Close #42377
2021-06-01 10:13:36 -07:00
Kapunahele Wong
253ed5d484 docs: improve accessibility of form-validation example (#41283)
PR Close #41283
2021-05-03 14:25:11 -07:00
Alexey Elin
25892c1bcf docs: add links to TypeScript (#40410)
PR Close #40410
2021-01-13 14:02:32 -08:00
Judy Bogart
7eb1a58b26 docs: refactor form validation doc to be task-oriented (#36374)
rework content to meet current documentation standards and conventions, structure as task-oriented document

PR Close #36374
2020-05-11 10:59:50 -07:00
Sonu Kapoor
9a0a90feb3 docs: place download section in angular forms validation to the top of the page (#36074)
This commit partially addresses #35459

PR Close #36074
2020-04-03 11:03:36 -07:00
Judy Bogart
efdf347f9c docs: apply standard header case convention (#34196)
PR Close #34196
2020-01-10 08:38:53 -08:00
George Kalpakas
1bcd58cee8 refactor(docs-infra): remove linenums=false since it is now the default (#31674)
PR Close #31674
2019-07-24 14:38:54 -07:00
Lucas
dc1ed3c47e docs: fix ngModel typo in form validation guide (#27574)
Fix typo

PR Close #27574
2018-12-11 16:22:58 -08:00
William Marques
fc6dad40ac fix(docs-infra): rename "title" by "header" to avoid unwanted tooltips (#26396)
Closes #26174

PR Close #26396
2018-10-17 11:05:29 -07:00
Tomasz Kula
c8c1aa7fc0 docs(aio): add async validation chapter (#25189)
Closes #22881

PR Close #25189
2018-08-10 09:14:25 -07:00
Stefanie Fluin
d523630ea2 docs(aio): cleanup aalert, callout, subsection use and author style (#24986)
PR Close #24986
2018-07-24 08:22:14 -07:00
Tomasz Kula
5c0e681bf3 docs(aio): fix adding to template driven forms (#23743)
PR Close #23743
2018-06-26 11:03:36 -07:00
Tomasz Kula
7d6e833a6f docs(aio): fix issues suggested by Brandon (#23743)
PR Close #23743
2018-06-26 11:03:35 -07:00
Tomasz Kula
49e900d6fc docs(aio): fix issues suggested by Kara (#23743)
PR Close #23743
2018-06-26 11:03:35 -07:00
Tomasz Kula
5feb9e1935 docs(aio): address pr review issues (#23743)
PR Close #23743
2018-06-26 11:03:35 -07:00
Tomasz Kula
002a5afa98 docs(aio): add cross field validation example (#23743)
PR Close #23743
2018-06-26 11:03:35 -07:00
Aric Thorn
cd4c0eab94 docs(forms): Custom Validator example selector name incorrect. (#20464)
Name of selector in ForbiddenName example is not consistent with Validator class nor Html selector example. Added the selector name 'appForbiddenName' as an alias name for the input of the Validator class, and updated the view accordingly.

Fixes: #20206

PR Close #20464
2018-02-07 12:01:12 -08:00
Aditya Bhardwaj
8e24c0fff4 docs(aio): fix typo (#20103)
PR Close #20103
2017-11-10 10:59:35 -08:00
Daniel Karp
c80e02b881 docs(aio): document Custom Async validators
docs(aio): Custom Async validators edits

incorporating suggestions from kapunahelewong
2017-10-04 15:07:46 -07:00
Jesus Rodriguez
9bbf009dff build(aio): change examples to CLI (#19248)
PR Close #19248
2017-09-21 17:05:54 -07:00
Kapunahele Wong
9b015a95eb docs(aio): tech edits to form validation
closes #18495
2017-08-03 13:57:31 -07:00
Kara Erickson
939dc44391 docs(forms): update and re-organize validation guide 2017-08-03 13:56:53 -07:00
Peter Bacon Darwin
b30c5fc874 docs(aio): fix dangling links 2017-07-11 11:44:05 +01:00
Victor Berchet
c723d42d0a refactor: fix typos (#18000) 2017-07-07 16:55:17 -07:00
Kapunahele Wong
92bcfefc35 docs(aio): remove min, max & move built-in validators paragraph 2017-06-22 14:51:05 -07:00
Kapunahele Wong
2b1de07f02 docs(aio): incorporate Ward's comments 2017-06-15 07:46:44 +01:00
Kapunahele Wong
fb877696bf docs(aio): add short section on built-in validators, copy edits 2017-06-15 07:46:44 +01:00
Jesús Rodríguez
cd5bc64658 docs(aio): update headers for toc (#16969) 2017-05-26 13:28:06 -06:00
Jesus Rodriguez
56833a6171 docs(aio): more content fixes 2017-05-10 12:51:01 +01:00
Jesús Rodríguez
03610526e5 docs(aio): remove hardcoded TOC 2017-05-04 15:51:37 -07:00
Ward Bell
93516ea8a1 docs(aio): rename cb- files and a few others 2017-04-24 14:00:51 +01:00
Natalie Sidhom
7a8bd99ab1 docs(aio): correct some minor typos in the form validation cookbook (#16068) 2017-04-21 13:37:28 -07:00
Peter Bacon Darwin
df619adc76 docs(aio): update to remark syntax 2017-04-12 12:24:02 -07:00
Jesus Rodriguez
0e38bf9de0 build(aio): new migration 2017-04-03 15:41:05 -07:00
Peter Bacon Darwin
46f8a6dd85 docs(aio): remove unnecessary blank lines 2017-03-31 16:22:08 +01:00
Peter Bacon Darwin
2d14c3b17a docs(aio): ensure blank lines before HTML blocks in markdown 2017-03-31 08:05:33 +01:00
Peter Bacon Darwin
fd72fad8fd docs(aio): update migrated content from anguar.io 2017-03-28 10:21:46 +01:00
Peter Bacon Darwin
ab40fcb068 docs(aio): fix relative links
The migrator was updated to automatically fix these links.
See fca5fb0280
and 3927b7a038

The result of this is that, going forward, we should ask
authors to include the path from the base href to the thing
being linked. E.g. guide/architecture#intro
2017-03-13 16:56:23 -07:00
Peter Bacon Darwin
1847550ad1 docs(aio): move cookbooks into guide
Also update all docs with migrated versions from latest angular.io

Fixes #14941
2017-03-13 16:56:23 -07:00