Created
July 17, 2017 12:21
-
-
Save EdenStack/1ceb80e0db11b8e9a66a158618686845 to your computer and use it in GitHub Desktop.
NgNoValidate
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
/** | |
* @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 { | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment