docs(aio): http guide shows how to import toPromise operator from rxjs

Solves #17454
This commit is contained in:
David Herges 2017-06-13 11:51:30 +02:00 committed by Pete Bacon Darwin
parent a8afa65a54
commit 06a0cf2e31
1 changed files with 3 additions and 0 deletions

View File

@ -407,6 +407,9 @@ like the Observable-based version.
</div>
First, make sure to import the `toPromise` operator of the RxJS library.
<code-example path="http/src/app/toh/hero.service.promise.ts" region="rxjs-imports" title="src/app/toh/hero.service.promise.ts (import rxjs)" linenums="false"></code-example>
Here is a comparison of the `HeroService` using Promises versus Observables,
highlighting just the parts that are different.