docs(forms): add text about min() and max() as functions (#21110)
PR Close #21110
This commit is contained in:
parent
a0ffdf1ef2
commit
a66cd526c3
|
@ -75,6 +75,8 @@ const EMAIL_REGEXP =
|
||||||
export class Validators {
|
export class Validators {
|
||||||
/**
|
/**
|
||||||
* Validator that requires controls to have a value greater than a number.
|
* Validator that requires controls to have a value greater than a number.
|
||||||
|
*`min()` exists only as a function, not as a directive. For example,
|
||||||
|
* `control = new FormControl('', Validators.min(3));`.
|
||||||
*/
|
*/
|
||||||
static min(min: number): ValidatorFn {
|
static min(min: number): ValidatorFn {
|
||||||
return (control: AbstractControl): ValidationErrors | null => {
|
return (control: AbstractControl): ValidationErrors | null => {
|
||||||
|
@ -90,6 +92,8 @@ export class Validators {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Validator that requires controls to have a value less than a number.
|
* Validator that requires controls to have a value less than a number.
|
||||||
|
* `max()` exists only as a function, not as a directive. For example,
|
||||||
|
* `control = new FormControl('', Validators.max(15));`.
|
||||||
*/
|
*/
|
||||||
static max(max: number): ValidatorFn {
|
static max(max: number): ValidatorFn {
|
||||||
return (control: AbstractControl): ValidationErrors | null => {
|
return (control: AbstractControl): ValidationErrors | null => {
|
||||||
|
|
Loading…
Reference in New Issue