@@ -59,7 +59,7 @@ block http-providers
5959 So we register them in the `imports` array of `app.module.ts` where we
6060 bootstrap the application and its root `AppComponent`.
6161
62- + makeExcerpt( 'app/app.module.ts (v1)' )
62+ + makeExample( 'app/app.module.ts' , 'v1' , 'app/app.module.ts (v1)' )
6363
6464 :marked
6565 Notice that we supply `!{_HttpModule}` as part of the *imports* !{_array} in root NgModule `AppModule`.
@@ -88,10 +88,16 @@ block http-providers
8888
8989block backend
9090 :marked
91- We're replacing the default `XHRBackend`, the service that talks to the remote server,
92- with the in-memory web API service after priming it as follows:
91+ We're importing the `InMemoryWebApiModule` and adding it to the module `imports`.
92+ The `InMemoryWebApiModule` replaces the default `Http` client backend —
93+ the supporting service that talks to the remote server —
94+ with an _in-memory web API alternative service_.
95+ + makeExcerpt(_appModuleTsVsMainTs, 'in-mem-web-api' , '' )
96+ :marked
97+ The `forRoot` configuration method takes an `InMemoryDataService` class
98+ that will prime the in-memory database as follows:
9399
94- + makeExample('app/in-memory-data.service.ts' , 'init' )
100+ + makeExample('app/in-memory-data.service.ts' , 'init' )( format = '.' )
95101
96102p This file replaces the #[ code #[ + adjExPath('mock-heroes.ts' )] ] which is now safe to delete.
97103
@@ -500,24 +506,25 @@ block observable-transformers
500506 We take a different approach in this example.
501507 We combine all of the RxJS `Observable` extensions that _our entire app_ requires into a single RxJS imports file.
502508
503- + makeExample('app/rxjs-extensions.ts' )
509+ + makeExample('app/rxjs-extensions.ts' )( format = '.' )
504510
505511 :marked
506512 We load them all at once by importing `rxjs-extensions` in `AppComponent`.
507513
508- + makeExcerpt('app/app.component.ts' , 'rxjs-extensions' )
514+ + makeExcerpt('app/app.component.ts' , 'rxjs-extensions' )( format = '.' )
509515
510516:marked
511517 ### Add the search component to the dashboard
512518
513519 We add the hero search HTML element to the bottom of the `DashboardComponent` template.
514520
515- + makeExample('app/dashboard.component.html' )
521+ + makeExample('app/dashboard.component.html' )( format = '.' )
516522
517523- var _declarations = _docsFor == ' dart' ? ' directives' : ' declarations'
518524- var declFile = _docsFor == ' dart' ? ' app/dashboard.component.ts' : ' app/app.module.ts'
519525:marked
520- And finally, we import the `HeroSearchComponent` and add it to the `!{_declarations}` !{_array}:
526+ And finally, we import the `HeroSearchComponent` from `'./hero-search.component.ts'`
527+ and add it to the `!{_declarations}` !{_array}:
521528
522529+ makeExcerpt(declFile, 'search' )
523530
0 commit comments