From a66cd526c37055641effbe1760b648139ca21b12 Mon Sep 17 00:00:00 2001 From: Kapunahele Wong Date: Wed, 20 Dec 2017 09:49:57 -0500 Subject: [PATCH] docs(forms): add text about min() and max() as functions (#21110) PR Close #21110 --- packages/forms/src/validators.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/forms/src/validators.ts b/packages/forms/src/validators.ts index cc87a22f86..8f8f6cfa70 100644 --- a/packages/forms/src/validators.ts +++ b/packages/forms/src/validators.ts @@ -75,6 +75,8 @@ const EMAIL_REGEXP = export class Validators { /** * 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 { return (control: AbstractControl): ValidationErrors | null => { @@ -90,6 +92,8 @@ export class Validators { /** * 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 { return (control: AbstractControl): ValidationErrors | null => {