-
Notifications
You must be signed in to change notification settings - Fork 27.4k
Enhanced form examples to utilize $touched #10066
Conversation
The "Binding to form and control state" example now more closely reflects how users will accomplish form validation in 1.3. For example, users are now informed of validation requirements upon clicking Save.
I'm sorry, but I wasn't able to verify your Contributor License Agreement (CLA) signature. CLA signature is required for any code contributions to AngularJS. Please sign our CLA and ensure that the CLA signature email address and the email address in this PR's commits match. If you signed the CLA as a corporation, please let us know the company's name. Thanks a bunch! PS: If you signed the CLA in the past then most likely the email addresses don't match. Please sign the CLA again or update the email address in the commit of this PR. |
I don't really see how this is closer to how form-validation is done in 1.3. |
+1 |
@gkalpak You're correct. It isn't really accurate to say this is "how form validation is done in 1.3". I believe this pull request has the following benefits:
|
- RESET button is enabled only if form has some changes | ||
- SAVE button is enabled only if form has some changes and is valid | ||
- custom error messages for `user.email` and `user.agree` | ||
- Custom error message displayed upon interacting (touching) a field or submitting the form |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not really correct. "Touching" implies (to me) the error is added when the input is focused, but it's actually only set when it is blurred.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Angular 1.3 has defined touched
to mean that the control has been blurred.
See https://docs.angularjs.org/guide/forms
ng-touched
: the control has been blurred
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know. But the text is still not clear
Custom error message displayed upon interacting (touching) a field
For somone who doesn't know angular this sounds like the class will be set immediately on interacting or touching the input. Interacting is misleading, touching is ambiguous.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed. Good feedback.
Hi @claycephas - can you ensure that you have signed the CLA and that your GitHub account name is there. See https://cla.developers.google.com/clas |
Signed. Thanks. |
CLAs look good, thanks! |
The "Binding to form and control state" example now more closely reflects how users will accomplish form validation in 1.3. For example, users are now informed of validation requirements upon clicking Save.