From c80e02b8814fded487cb2a912fd12cde7cdd700b Mon Sep 17 00:00:00 2001 From: Daniel Karp Date: Tue, 26 Sep 2017 10:58:17 -0400 Subject: [PATCH] docs(aio): document Custom Async validators docs(aio): Custom Async validators edits incorporating suggestions from kapunahelewong --- aio/content/guide/form-validation.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/aio/content/guide/form-validation.md b/aio/content/guide/form-validation.md index a0c6231369..a01d861425 100644 --- a/aio/content/guide/form-validation.md +++ b/aio/content/guide/form-validation.md @@ -139,6 +139,10 @@ null if the control value is valid _or_ a validation error object. The validation error object typically has a property whose name is the validation key, `'forbiddenName'`, and whose value is an arbitrary dictionary of values that you could insert into an error message, `{name}`. +Custom async validators are similar to sync validators, but they must instead return a Promise or Observable +that later emits null or a validation error object. In the case of an Observable, the Observable must complete, +at which point the form uses the last value emitted for validation. + ### Adding to reactive forms In reactive forms, custom validators are fairly simple to add. All you have to do is pass the function directly