From 5f2897be0b13f26019b91acb5ee0f5614b26ff79 Mon Sep 17 00:00:00 2001 From: Sonu Kapoor Date: Wed, 11 Dec 2019 13:28:19 -0500 Subject: [PATCH] docs(forms): Update catchError to return an `observable` (#34357) Closes #34323 PR Close #34357 --- .../form-validation/src/app/shared/alter-ego.directive.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/aio/content/examples/form-validation/src/app/shared/alter-ego.directive.ts b/aio/content/examples/form-validation/src/app/shared/alter-ego.directive.ts index f8230e3195..bf08aa6bd3 100644 --- a/aio/content/examples/form-validation/src/app/shared/alter-ego.directive.ts +++ b/aio/content/examples/form-validation/src/app/shared/alter-ego.directive.ts @@ -7,7 +7,7 @@ import { } from '@angular/forms'; import { catchError, map } from 'rxjs/operators'; import { HeroesService } from './heroes.service'; -import { Observable } from 'rxjs'; +import { Observable, of } from 'rxjs'; // #docregion async-validator @Injectable({ providedIn: 'root' }) @@ -19,7 +19,7 @@ export class UniqueAlterEgoValidator implements AsyncValidator { ): Promise | Observable { return this.heroesService.isAlterEgoTaken(ctrl.value).pipe( map(isTaken => (isTaken ? { uniqueAlterEgo: true } : null)), - catchError(() => null) + catchError(() => of(null)) ); } }