RequiredValidator
Stable Directive
Обзор класса
class RequiredValidator implements Validator {
required : boolean
validate(c: AbstractControl) : {[key: string]: any}
registerOnValidatorChange(fn: () => void) : void
}
Селекторы
:not([type=checkbox])[required][formControlName]
:not([type=checkbox])[required][formControl]
:not([type=checkbox])[required][ngModel]
Описание класса
Директива, добавляющая валидатор required к любым элементам управления, помеченным атрибутом required, через привязку NG_VALIDATORS.
Пример
<input name="fullName" ngModel required>
Подробное описание класса
required : boolean
validate(c: AbstractControl) : {[key: string]: any}
registerOnValidatorChange(fn: () => void) : void
экспортировано из @angular/forms/index, определено в @angular/forms/src/directives/validators.ts
© 2010–2017 Google, Inc.
Licensed under the Creative Commons Attribution License 4.0.
https://v2.angular.io/docs/ts/latest/api/forms/index/RequiredValidator-directive.html