docs(http): Small typo fix in sentence reference to items: Observable
Ward tacked on router: ngDestroy -> ngOnDestroy closes #1690
This commit is contained in:
parent
e4c5fe32e7
commit
e766f666bd
|
@ -739,7 +739,7 @@ h4#snapshot <i>Snapshot</i>: the no-observable alternative
|
||||||
be re-used. We'll always re-create the component each time we navigate to it.
|
be re-used. We'll always re-create the component each time we navigate to it.
|
||||||
|
|
||||||
The router offers a *Snapshot* alternative that gives us the initial value of the route parameters.
|
The router offers a *Snapshot* alternative that gives us the initial value of the route parameters.
|
||||||
We don't need to subscribe. We don't have to unsubscribe in `ngDestroy`.
|
We don't need to subscribe. We don't have to unsubscribe in `ngOnDestroy`.
|
||||||
It's much simpler to write and read:
|
It's much simpler to write and read:
|
||||||
+makeExample('router/ts/app/heroes/hero-detail.component.2.ts','snapshot')(format=".")
|
+makeExample('router/ts/app/heroes/hero-detail.component.2.ts','snapshot')(format=".")
|
||||||
.l-sub-section
|
.l-sub-section
|
||||||
|
|
|
@ -540,7 +540,7 @@ block wikipedia-jsonp+
|
||||||
The component presents an `<input>` element *search box* to gather search terms from the user.
|
The component presents an `<input>` element *search box* to gather search terms from the user.
|
||||||
and calls a `search(term)` method after each `keyup` event.
|
and calls a `search(term)` method after each `keyup` event.
|
||||||
|
|
||||||
The `search(term)` method delegates to our `WikipediaService` which returns an observable array of string results (`Observable<string[]`).
|
The `search(term)` method delegates to our `WikipediaService` which returns an observable array of string results (`Observable<string[]>`).
|
||||||
Instead of subscribing to the observable inside the component as we did in the `HeroListComponent`,
|
Instead of subscribing to the observable inside the component as we did in the `HeroListComponent`,
|
||||||
we forward the observable result to the template (via `items`) where the [async pipe](pipes.html#async-pipe)
|
we forward the observable result to the template (via `items`) where the [async pipe](pipes.html#async-pipe)
|
||||||
in the `ngFor` handles the subscription.
|
in the `ngFor` handles the subscription.
|
||||||
|
|
Loading…
Reference in New Issue