@@ -5,7 +5,7 @@ block includes
55 - var _Http = ' BrowserClient' ;
66 - var _Angular_Http = ' Dart <code>BrowserClient</code>'
77 - var _httpUrl = ' https://pub.dartlang.org/packages/http'
8- - var _Angular_http_library = ' Dart <a href="' + _httpUrl + ' "><b>http</b></a> library '
8+ - var _Angular_http_library = ' Dart <a href="' + _httpUrl + ' "><b>http</b></a> package '
99 - var _HTTP_PROVIDERS = ' BrowserClient'
1010 - var _JSON_stringify = ' JSON.encode'
1111
@@ -20,22 +20,23 @@ block start-server-and-watch
2020
2121block http-library
2222 :marked
23- We'll be using the !{_Angular_Http} to communicate with a server.
24- This class is exported by the !{_Angular_http_library} .
23+ We'll be using the !{_Angular_http_library}'s
24+ `BrowserClient` class to communicate with a server .
2525
2626 ### Pubspec updates
2727
2828 We need to add a package dependency for the !{_Angular_http_library}.
2929
30- We also need to inform the Dart Angular 2 Transformer that we will be using
31- `BrowserClient` (we'll defer explaining _why_ this extra configuration is
32- needed until the [HTTP client chapter](../guide/server-communication.html#!#http-providers))
33- by means of the transformer's `resolved_identifiers` configuration parameter.
34- Since we will also be needing the !{_Angular_http_library} `Client` interface, we'll
35- add that now as well.
30+ We also need to add a `resolved_identifiers` entry, to inform the [angular2
31+ transformer][ng2x] that we'll be using `BrowserClient`. (For an explanation of why
32+ this extra configuration is needed, see the [HTTP client chapter][guide-http].) We'll
33+ also need to use `Client` from http, so let's add that now as well.
3634
3735 Update `pubspec.yaml` to look like this (additions are highlighted):
3836
37+ [guide-http]: ../guide/server-communication.html#!#http-providers
38+ [ng2x]: https://github.com/angular/angular/wiki/Angular-2-Dart-Transformer
39+
3940 - var stylePattern = { pnk: / (http. * | resolved_identifiers:| Browser. * | Client. * )/ gm };
4041 + makeExcerpt('pubspec.yaml' , 'additions' , null , stylePattern)
4142
@@ -48,7 +49,7 @@ block backend
4849 We want to replace `BrowserClient`, the service that talks to the remote server,
4950 with the in-memory web API service.
5051 Our in-memory web API service, shown below, is implemented using the
51- standard `http` library `MockClient` class.
52+ `http` library `MockClient` class.
5253 All `http` client implementations share a common `Client` interface, so
5354 we'll have our app use the `Client` type so that we can freely switch between
5455 implementations.
@@ -58,9 +59,9 @@ block dont-be-distracted-by-backend-subst
5859
5960block get-heroes-details
6061 :marked
61- We make an asynchronous call to `http.get()` which returns an HTTP
62- `Response `. The response payload (`body`) is decoded as JSON via the
63- `_extractData` helper method .
62+ To get the list of heroes, we first make an asynchronous call to
63+ `http.get() `. Then we use the `_extractData` helper method to decode the
64+ response payload (`body`) .
6465
6566block hero-detail-comp-extra-imports-and-vars
6667 //- N/A
0 commit comments