From ac1988d8e6869df6b6870363f0607f56e4403577 Mon Sep 17 00:00:00 2001 From: Frederik Schlemmer Date: Thu, 6 Sep 2018 07:53:08 +0200 Subject: [PATCH] docs: add missing instruction in HTTP section (#25715) PR Close #25715 --- .../examples/toh-pt6/src/app/in-memory-data.service.ts | 4 ++++ aio/content/tutorial/toh-pt6.md | 9 +++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/aio/content/examples/toh-pt6/src/app/in-memory-data.service.ts b/aio/content/examples/toh-pt6/src/app/in-memory-data.service.ts index 9679f21055..c590be5d65 100644 --- a/aio/content/examples/toh-pt6/src/app/in-memory-data.service.ts +++ b/aio/content/examples/toh-pt6/src/app/in-memory-data.service.ts @@ -1,7 +1,11 @@ // #docregion , init import { InMemoryDbService } from 'angular-in-memory-web-api'; import { Hero } from './hero'; +import { Injectable } from '@angular/core'; +@Injectable({ + providedIn: 'root', +}) export class InMemoryDataService implements InMemoryDbService { createDb() { const heroes = [ diff --git a/aio/content/tutorial/toh-pt6.md b/aio/content/tutorial/toh-pt6.md index c1c8cdea61..1c290bcb05 100644 --- a/aio/content/tutorial/toh-pt6.md +++ b/aio/content/tutorial/toh-pt6.md @@ -77,8 +77,13 @@ _after importing the `HttpClientModule`_, The `forRoot()` configuration method takes an `InMemoryDataService` class that primes the in-memory database. -The _Tour of Heroes_ sample creates such a class -`src/app/in-memory-data.service.ts` which has the following content: +The class `src/app/in-memory-data.service.ts` is generated by the following command: + + + ng generate service InMemoryData + + +This class has the following content: