docs: add missing import to `CartService` tutorial instructions (#42701)
PR Close #42701
This commit is contained in:
parent
0c0c32d539
commit
e064f177a7
|
@ -1,9 +1,9 @@
|
|||
// #docplaster
|
||||
// #docregion import-http
|
||||
import { Injectable } from '@angular/core';
|
||||
import { HttpClient } from '@angular/common/http';
|
||||
// #docregion props
|
||||
import { Product } from './products';
|
||||
// #enddocregion import-http
|
||||
// #enddocregion props, import-http
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
|
|
|
@ -30,6 +30,7 @@ This section walks you through adding a **Buy** button and setting up a cart ser
|
|||
|
||||
<code-example header="src/app/cart.service.ts" path="getting-started/src/app/cart.service.1.ts"></code-example>
|
||||
|
||||
1. Import the `Product` interface from `./products.js`.
|
||||
1. In the `CartService` class, define an `items` property to store the array of the current products in the cart.
|
||||
|
||||
<code-example path="getting-started/src/app/cart.service.ts" header="src/app/cart.service.ts" region="props"></code-example>
|
||||
|
|
Loading…
Reference in New Issue