-
Notifications
You must be signed in to change notification settings - Fork 24.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(forms): add option to use native validation and angular forms #13566
Conversation
25209f0
to
7c062aa
Compare
@Directive({ | ||
selector: 'form:not([ngNoForm])', | ||
selector: 'form:not([ngNoForm]):not([ngNoNovalidate])', |
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 would use ngNoNoValidate
?
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.
... or ngNativeValidate
?
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 chose ngNoNoValidate
to be consistent with ngNoForm
and others. And I agree it sounds odd :)
ngNativeValidate
I really like your proposal.
@DzmitryShylovich when adding new features, could you please make sure to create a GH issue on angular/angular.io to ask for it to be documented on top of adding API docs to the source code ? Thanks |
Could you please also rename |
7c062aa
to
80db419
Compare
@vicb done |
@DzmitryShylovich could you please mention the rename in the commit comment ? Have you opened an issue on angular/angular.io ? |
|
80db419
to
5bbfdb9
Compare
done |
The directive should be exported and the .d.ts updated |
@vicb why? It's a private api. |
5bbfdb9
to
7295f9b
Compare
@vicb I exported it |
@kara can you approve this? |
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.
LGTM. Added a nit in case you want to fix.
* | ||
* `novalidate` is used to disable browser's native form validation. | ||
* | ||
* If you want to use native validation with angular forms just add `ngNativeValidate` attribute: |
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.
Super nit: Can you add a comma? :)
If you want to use native validation with Angular forms, just add `ngNativeValidate` attribute:
7295f9b
to
8f75555
Compare
@kara done |
…r forms Also renames NgNovalidate -> NgNoValidate Closes angular#13573
8f75555
to
a2de0f8
Compare
…r forms (angular#13566) Also renames NgNovalidate -> NgNoValidate Closes angular#13573
…r forms (angular#13566) Also renames NgNovalidate -> NgNoValidate Closes angular#13573
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Closes #13573