From 545fdf10e2c1527f81cc47e33e3bcd4b0e271e90 Mon Sep 17 00:00:00 2001 From: jhenderson2099 Date: Sat, 30 Dec 2017 21:37:11 -0500 Subject: [PATCH] docs(aio): fix TOH inclusion of HeroesService. (#21228) Change docs where the MessageService is referenced Fixes #20398 PR Close #21228 --- aio/content/examples/toh-pt4/src/app/app.module.ts | 9 ++++++++- aio/content/tutorial/toh-pt4.md | 12 +++++++++++- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/aio/content/examples/toh-pt4/src/app/app.module.ts b/aio/content/examples/toh-pt4/src/app/app.module.ts index 70b26976da..f3cc34faff 100644 --- a/aio/content/examples/toh-pt4/src/app/app.module.ts +++ b/aio/content/examples/toh-pt4/src/app/app.module.ts @@ -21,7 +21,14 @@ import { MessagesComponent } from './messages/messages.component'; FormsModule ], // #docregion providers - providers: [ HeroService, MessageService ], + // #docregion providers-heroservice + providers: [ + HeroService, + // #enddocregion providers-heroservice + MessageService + // #docregion providers-heroservice + ], + // #enddocregion providers-heroservice // #enddocregion providers bootstrap: [ AppComponent ] }) diff --git a/aio/content/tutorial/toh-pt4.md b/aio/content/tutorial/toh-pt4.md index 807f886f31..241e50799f 100644 --- a/aio/content/tutorial/toh-pt4.md +++ b/aio/content/tutorial/toh-pt4.md @@ -97,7 +97,7 @@ Since you did not, you'll have to provide it yourself. Open the `AppModule` class, import the `HeroService`, and add it to the `@NgModule.providers` array. - + The `providers` array tells Angular to create a single, shared instance of `HeroService` @@ -105,6 +105,12 @@ and inject into any class that asks for it. The `HeroService` is now ready to plug into the `HeroesComponent`. +
+ +This is a interim code sample that will allow you to provide and use the `HeroService`. At this point, the code will differ from the `HeroService` in the ["final code review"](#final-code-review). + +
+
Learn more about _providers_ in the [Providers](guide/providers) guide. @@ -423,6 +429,10 @@ Here are the code files discussed on this page and your app should look like thi path="toh-pt4/src/app/messages/messages.component.css"> + + +