From 6a51704b4e5e768efddcb3264f04831bfab17034 Mon Sep 17 00:00:00 2001 From: Matthieu Riegler Date: Sat, 20 May 2023 01:11:29 +0200 Subject: [PATCH] docs: improve toh6 (#50375) Create the file, then import it in the AppModule. fixes #44073 PR Close #50375 --- .../tutorial/tour-of-heroes/toh-pt6.md | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/aio/content/tutorial/tour-of-heroes/toh-pt6.md b/aio/content/tutorial/tour-of-heroes/toh-pt6.md index 860ee476d71..c7285bb8ee8 100644 --- a/aio/content/tutorial/tour-of-heroes/toh-pt6.md +++ b/aio/content/tutorial/tour-of-heroes/toh-pt6.md @@ -51,16 +51,6 @@ npm install angular-in-memory-web-api --save -In the `AppModule`, import the `HttpClientInMemoryWebApiModule` and the `InMemoryDataService` class, which you create next. - - - -After the `HttpClientModule`, add the `HttpClientInMemoryWebApiModule` to the `AppModule` `imports` array and configure it with the `InMemoryDataService`. - - - -The `forRoot()` configuration method takes an `InMemoryDataService` class that primes the in-memory database. - Generate the class `src/app/in-memory-data.service.ts` with the following command: @@ -73,6 +63,16 @@ Replace the default contents of `in-memory-data.service.ts` with the following: +In the `AppModule`, import the `HttpClientInMemoryWebApiModule` and the `InMemoryDataService` class, which you create next. + + + +After the `HttpClientModule`, add the `HttpClientInMemoryWebApiModule` to the `AppModule` `imports` array and configure it with the `InMemoryDataService`. + + + +The `forRoot()` configuration method takes an `InMemoryDataService` class that primes the in-memory database. + The `in-memory-data.service.ts` file takes over the function of `mock-heroes.ts`. Don't delete `mock-heroes.ts` yet. You still need it for a few more steps of this tutorial.