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
|
// #docregion import-http
|
||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
import { HttpClient } from '@angular/common/http';
|
import { HttpClient } from '@angular/common/http';
|
||||||
|
// #docregion props
|
||||||
import { Product } from './products';
|
import { Product } from './products';
|
||||||
// #enddocregion import-http
|
// #enddocregion props, import-http
|
||||||
|
|
||||||
@Injectable({
|
@Injectable({
|
||||||
providedIn: 'root'
|
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>
|
<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.
|
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>
|
<code-example path="getting-started/src/app/cart.service.ts" header="src/app/cart.service.ts" region="props"></code-example>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user