https://github.com/angular/angular
Raw File
Tip revision: 9b4263bf70039ebb9f8d1eb81fc082d8a2c63a15 authored by Joey Perrott on 10 February 2021, 23:32:04 UTC
release: cut the v12.0.0-next.0 release (#40793)
Tip revision: 9b4263b
ng_no_validate_directive.ts
/**
 * @license
 * Copyright Google LLC 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';

/**
 * @description
 *
 * 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>
 * ```
 *
 * @publicApi
 * @ngModule ReactiveFormsModule
 * @ngModule FormsModule
 */
@Directive({
  selector: 'form:not([ngNoForm]):not([ngNativeValidate])',
  host: {'novalidate': ''},
})
export class ɵNgNoValidate {
}

export {ɵNgNoValidate as NgNoValidate};
back to top