Skip to content

Instantly share code, notes, and snippets.

@EdenStack
Created July 17, 2017 12:21
Show Gist options
  • Save EdenStack/1ceb80e0db11b8e9a66a158618686845 to your computer and use it in GitHub Desktop.
Save EdenStack/1ceb80e0db11b8e9a66a158618686845 to your computer and use it in GitHub Desktop.
NgNoValidate
/**
* @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