RequiredValidator

Stable Directive

Class Overview

class RequiredValidator {
  required : boolean
  validate(c: AbstractControl) : {[key: string]: any}
  registerOnValidatorChange(fn: () => void)
}

Selectors

[required][formControlName]

[required][formControl]

[required][ngModel]

Class Description

A Directive that adds the required validator to any controls marked with the required attribute, via the NG_VALIDATORS binding.

Example

<input name="fullName" ngModel required>

Class Details

required : boolean
validate(c: AbstractControl) : {[key: string]: any}
registerOnValidatorChange(fn: () => void)

exported from @angular/forms/index, defined in @angular/forms/src/directives/validators.ts

doc_Angular
2016-10-06 09:46:55
Comments
Leave a Comment

Please login to continue.