From b04c3cce096a91c90defc0029426ae27829e18a4 Mon Sep 17 00:00:00 2001 From: Kristina Gocheva Date: Thu, 16 Jan 2020 10:30:29 +0200 Subject: [PATCH] docs: fix logging upon search in example tutorial (#34806) When no errors are thrown but empty array is returned we should log different message. PR Close #34806 --- aio/content/examples/toh-pt6/src/app/hero.service.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/aio/content/examples/toh-pt6/src/app/hero.service.ts b/aio/content/examples/toh-pt6/src/app/hero.service.ts index 747ba05c80..740b822313 100644 --- a/aio/content/examples/toh-pt6/src/app/hero.service.ts +++ b/aio/content/examples/toh-pt6/src/app/hero.service.ts @@ -86,7 +86,9 @@ export class HeroService { return of([]); } return this.http.get(`${this.heroesUrl}/?name=${term}`).pipe( - tap(_ => this.log(`found heroes matching "${term}"`)), + tap(x => x.length ? + this.log(`found heroes matching "${term}"`) : + this.log(`no heroes matching "${term}"`)), catchError(this.handleError('searchHeroes', [])) ); }