X-Git-Url: https://juplo.de/gitweb/?p=examples%2Fangular-tutorial;a=blobdiff_plain;f=src%2Fapp%2Fcart.service.ts;h=0d6851894b2dffd7970d526ed6767276fb0d2880;hp=aeb5d9e9d9352e1c9abbd2500fa591f7c83be722;hb=ee115f4fe5bf9c35ef9ee5a1ae41b76e0bb88ea5;hpb=6488b34b5f23a7372b3f9054e998a137961b971f diff --git a/src/app/cart.service.ts b/src/app/cart.service.ts index aeb5d9e..0d68518 100644 --- a/src/app/cart.service.ts +++ b/src/app/cart.service.ts @@ -1,4 +1,5 @@ import { Injectable } from '@angular/core'; +import { HttpClient } from '@angular/common/http'; @Injectable({ providedIn: 'root' @@ -7,7 +8,7 @@ export class CartService { items= []; - constructor() { } + constructor(private http: HttpClient) { } addToCart(product) { this.items.push(product); @@ -21,4 +22,8 @@ export class CartService { this.items = []; return this.items; } + + getShippingPrices() { + return this.http.get('/assets/shipping.json'); + } }