-
Notifications
You must be signed in to change notification settings - Fork 25.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(forms): add option to use browser's native validation and angula…
- Loading branch information
Showing
4 changed files
with
46 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
modules/@angular/forms/src/directives/ng_no_validate_directive.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
/** | ||
* @license | ||
* Copyright Google Inc. All Rights Reserved. | ||
* | ||
* Use of this source code is governed by an MIT-style license that can be | ||
* found in the LICENSE file at https://angular.io/license | ||
*/ | ||
|
||
import {Directive} from '@angular/core'; | ||
|
||
/** | ||
* @whatItDoes Adds `novalidate` attribute to all forms by default. | ||
* | ||
* `novalidate` is used to disable browser's native form validation. | ||
* | ||
* If you want to use native validation with Angular forms, just add `ngNativeValidate` attribute: | ||
* | ||
* ``` | ||
* <form ngNativeValidate></form> | ||
* ``` | ||
* | ||
* @experimental | ||
*/ | ||
@Directive({ | ||
selector: 'form:not([ngNoForm]):not([ngNativeValidate])', | ||
host: {'novalidate': ''}, | ||
}) | ||
export class NgNoValidate { | ||
} |
16 changes: 0 additions & 16 deletions
16
modules/@angular/forms/src/directives/ng_novalidate_directive.ts
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters