MinLengthValidator
directive
npm Package | @angular/forms |
---|---|
Module | import { MinLengthValidator } from '@angular/forms'; |
Source | forms/src/directives/validators.ts |
Overview
@Directive({ selector: '[minlength][formControlName],[minlength][formControl],[minlength][ngModel]', providers: [MIN_LENGTH_VALIDATOR], host: { '[attr.minlength]': 'minlength ? minlength : null' } }) class MinLengthValidator implements Validator, OnChanges { minlength: string ngOnChanges(changes: SimpleChanges): void validate(c: AbstractControl): ValidationErrors | null registerOnValidatorChange(fn: () => void): void }
Selectors
[minlength][formControlName]
[minlength][formControl]
[minlength][ngModel]
Inputs
minlength
bound to MinLengthValidator.minlength
Description
A directive which installs the MinLengthValidator
for any formControlName
, formControl
, or control with ngModel
that also has a minlength
attribute.
Members
minlength: string
ngOnChanges(changes: SimpleChanges): void
validate(c: AbstractControl): ValidationErrors | null
registerOnValidatorChange(fn: () => void): void
© 2010–2018 Google, Inc.
Licensed under the Creative Commons Attribution License 4.0.
https://v5.angular.io/api/forms/MinLengthValidator