Skip to content
This repository was archived by the owner on Dec 4, 2017. It is now read-only.

Commit 101d2ef

Browse files
chalinkwalrath
authored andcommitted
chore(toh-6): refresh cache file (#2207)
No other changes.
1 parent e4ed1ce commit 101d2ef

File tree

1 file changed

+24
-23
lines changed

1 file changed

+24
-23
lines changed

public/docs/ts/_cache/tutorial/toh-pt6.jade

+24-23
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ block includes
1212
- var _promise = _Promise.toLowerCase()
1313

1414
:marked
15-
# Getting and Saving Data using HTTP
15+
# Getting and Saving Data
1616

1717
Our stakeholders appreciate our progress.
1818
Now they want to get the hero data from a server, let users add, edit, and delete heroes,
@@ -46,22 +46,22 @@ block start-server-and-watch
4646
h1 Providing HTTP Services
4747
block http-library
4848
:marked
49-
`Http` is ***not*** a core Angular module.
49+
The `HttpModule` is ***not*** a core Angular module.
5050
It's Angular's optional approach to web access and it exists as a separate add-on module called `@angular/http`,
5151
shipped in a separate script file as part of the Angular npm package.
5252

5353
Fortunately we're ready to import from `@angular/http` because `systemjs.config` configured *SystemJS* to load that library when we need it.
5454

5555
:marked
56-
### Register (provide) HTTP services
56+
### Register for HTTP services
5757

5858
block http-providers
5959
:marked
6060
Our app will depend upon the Angular `http` service which itself depends upon other supporting services.
61-
The `HttpModule` from `@angular/http` library holds providers for the complete set of `http` services.
61+
The `HttpModule` from `@angular/http` library holds providers for a complete set of HTTP services.
6262

63-
We should be able to access `http` services from anywhere in the application.
64-
So we register them in the `imports` array of `app.module.ts` where we
63+
We should be able to access these services from anywhere in the application.
64+
So we register them all by adding `HttpModule` to the `imports` list of the `AppModule` where we
6565
bootstrap the application and its root `AppComponent`.
6666

6767
+makeExample('app/app.module.ts', 'v1','app/app.module.ts (v1)')
@@ -174,7 +174,7 @@ block get-heroes-details
174174
:marked
175175
### Extracting the data in the *then* callback
176176

177-
In the *promise*'s `then` callback we call the `json` method of the http `Response` to extract the
177+
In the *promise*'s `then` callback we call the `json` method of the HTTP `Response` to extract the
178178
data within the response.
179179
+makeExcerpt('app/hero.service.ts', 'to-data', '')
180180

@@ -219,17 +219,18 @@ block get-heroes-details
219219
Although we made significant *internal* changes to `getHeroes()`, the public signature did not change.
220220
We still return a !{_Promise}. We won't have to update any of the components that call `getHeroes()`.
221221

222-
Our stakeholders are incredibly pleased with the added flexibility from the API integration, but it doesn't stop there. Next, we want the ability to create new heroes and delete heroes.
222+
Our stakeholders are thrilled with the added flexibility from the API integration.
223+
Now they want the ability to create and delete heroes.
223224

224-
But first, let's see what happens now when we try to update a hero's details.
225+
Let's see first what happens when we try to update a hero's details.
225226

226227
.l-main-section
227228
:marked
228229
## Update hero details
229230

230-
The hero detail view already allows us to edit a hero's name. Go ahead, try
231-
it now. As we type, the hero name is updated in the view heading, but
232-
notice what happens when we hit the `Back` button: the changes are lost!
231+
We can edit a hero's name already in the hero detail view. Go ahead and try
232+
it. As we type, the hero name is updated in the view heading.
233+
But when we hit the `Back` button, the changes are lost!
233234

234235
.l-sub-section
235236
:marked
@@ -348,7 +349,7 @@ block get-heroes-details
348349

349350
block observables-section-intro
350351
:marked
351-
Each `Http` method returns an `Observable` of HTTP `Response` objects.
352+
Each `Http` service method returns an `Observable` of HTTP `Response` objects.
352353

353354
Our `HeroService` converts that `Observable` into a `Promise` and returns the promise to the caller.
354355
In this section we learn to return the `Observable` directly and discuss when and why that might be
@@ -364,7 +365,7 @@ block observables-section-intro
364365
Recall that our `HeroService` quickly chained the `toPromise` operator to the `Observable` result of `http.get`.
365366
That operator converted the `Observable` into a `Promise` and we passed that promise back to the caller.
366367

367-
Converting to a promise is often a good choice. We typically ask `http` to fetch a single chunk of data.
368+
Converting to a promise is often a good choice. We typically ask `http.get` to fetch a single chunk of data.
368369
When we receive the data, we're done.
369370
A single result in the form of a promise is easy for the calling component to consume
370371
and it helps that promises are widely understood by JavaScript programmers.
@@ -456,21 +457,21 @@ block observable-transformers
456457

457458
.l-sub-section
458459
:marked
459-
The [switchMap operator](https://github.com/Reactive-Extensions/RxJS/blob/master/doc/api/core/operators/flatmaplatest.md)
460+
The [switchMap operator](http://www.learnrxjs.io/operators/transformation/switchmap.html)
460461
(formerly known as "flatMapLatest") is very clever.
461462

462-
Every qualifying key event can trigger an http call.
463-
Even with a 300ms pause between requests, we could have multiple http requests in flight
463+
Every qualifying key event can trigger an `http` method call.
464+
Even with a 300ms pause between requests, we could have multiple HTTP requests in flight
464465
and they may not return in the order sent.
465466

466467
`switchMap` preserves the original request order while returning
467-
only the observable from the most recent http call.
468+
only the observable from the most recent `http` method call.
468469
Results from prior calls are canceled and discarded.
469470

470-
We also short-circuit the http call and return an observable containing an empty array
471+
We also short-circuit the `http` method call and return an observable containing an empty array
471472
if the search text is empty.
472473

473-
Note that _canceling_ the `HeroSearchService` observable won't actually abort a pending http request
474+
Note that _canceling_ the `HeroSearchService` observable won't actually abort a pending HTTP request
474475
until the service supports that feature, a topic for another day.
475476
We are content for now to discard unwanted results.
476477
:marked
@@ -495,9 +496,9 @@ block observable-transformers
495496
+makeExample('app/rxjs-extensions.ts')(format='.')
496497

497498
:marked
498-
We load them all at once by importing `rxjs-extensions` in `AppComponent`.
499+
We load them all at once by importing `rxjs-extensions` at the top of `AppModule`.
499500

500-
+makeExcerpt('app/app.component.ts', 'rxjs-extensions')(format='.')
501+
+makeExcerpt('app/app.module.ts', 'rxjs-extensions')(format='.')
501502

502503
:marked
503504
### Add the search component to the dashboard
@@ -509,7 +510,7 @@ block observable-transformers
509510
- var _declarations = _docsFor == 'dart' ? 'directives' : 'declarations'
510511
- var declFile = _docsFor == 'dart' ? 'app/dashboard.component.ts' : 'app/app.module.ts'
511512
:marked
512-
And finally, we import `HeroSearchComponent` from
513+
Finally, we import `HeroSearchComponent` from
513514
<span ngio-ex>hero-search.component.ts</span>
514515
and add it to the `!{_declarations}` !{_array}:
515516

0 commit comments

Comments
 (0)