docs(http/toh-6): improve references to in-mem-web-api (#2964)
This commit is contained in:
parent
20f47aa600
commit
9cf71d4b00
|
@ -32,8 +32,8 @@ block includes
|
||||||
<li> [Search parameters](#search-parameters).</li>
|
<li> [Search parameters](#search-parameters).</li>
|
||||||
<li> [More fun with observables](#more-observables).</li>
|
<li> [More fun with observables](#more-observables).</li>
|
||||||
</ul>
|
</ul>
|
||||||
- [Guarding against Cross-Site Request Forgery](#xsrf)
|
- [Guarding against Cross-Site Request Forgery](#xsrf).
|
||||||
- [Appendix: Tour of Heroes in-memory server](#in-mem-web-api).
|
- [Appendix: Tour of Heroes _in-memory web api_](#in-mem-web-api).
|
||||||
|
|
||||||
A <live-example>live example</live-example> illustrates these topics.
|
A <live-example>live example</live-example> illustrates these topics.
|
||||||
|
|
||||||
|
@ -669,14 +669,18 @@ a#in-mem-web-api
|
||||||
The *get heroes* scenario would work,
|
The *get heroes* scenario would work,
|
||||||
but since the app can't save changes to a JSON file, it needs a web API server.
|
but since the app can't save changes to a JSON file, it needs a web API server.
|
||||||
Because there isn't a real server for this demo,
|
Because there isn't a real server for this demo,
|
||||||
it uses an *in-memory web API simulator* instead.
|
it substitutes the Angular _in-memory web api_ simulator for the actual XHR backend service.
|
||||||
|
|
||||||
.l-sub-section
|
.l-sub-section
|
||||||
:marked
|
:marked
|
||||||
The in-memory web api is not part of the Angular core.
|
The in-memory web api is not part of Angular _proper_.
|
||||||
It's an optional service in its own `angular-in-memory-web-api` library
|
It's an optional service in its own
|
||||||
installed with npm (see `package.json`) and
|
<a href="https://github.com/angular/in-memory-web-api" target="_blank" title="In-memory Web API"><i>angular-in-memory-web-api</i></a>
|
||||||
registered for module loading by SystemJS (see `systemjs.config.js`).
|
library installed with npm (see `package.json`).
|
||||||
|
|
||||||
|
See the
|
||||||
|
<a href="https://github.com/angular/in-memory-web-api/blob/master/README.md" target="_blank" title='In-memory Web API "README.md"'><i>README file</i></a>
|
||||||
|
for configuration options, default behaviors, and limitations.
|
||||||
|
|
||||||
:marked
|
:marked
|
||||||
The in-memory web API gets its data from !{_a_ca_class_with} a `createDb()`
|
The in-memory web API gets its data from !{_a_ca_class_with} a `createDb()`
|
||||||
|
|
|
@ -91,10 +91,9 @@ block http-providers
|
||||||
|
|
||||||
block backend
|
block backend
|
||||||
:marked
|
:marked
|
||||||
We're importing the `InMemoryWebApiModule` and adding it to the module `imports`.
|
Rather than require a real API server, this example simulates communication with the remote server by adding the
|
||||||
The `InMemoryWebApiModule` replaces the default `Http` client backend —
|
<a href="https://github.com/angular/in-memory-web-api" target="_blank" title="In-memory Web API"><i>InMemoryWebApiModule</i></a>
|
||||||
the supporting service that talks to the remote server —
|
to the module `imports`, effectively replacing the `Http` client's XHR backend service with an in-memory alternative.
|
||||||
with an _in-memory web API alternative service_.
|
|
||||||
|
|
||||||
+makeExcerpt(_appModuleTsVsMainTs, 'in-mem-web-api', '')
|
+makeExcerpt(_appModuleTsVsMainTs, 'in-mem-web-api', '')
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue