From 6488b34b5f23a7372b3f9054e998a137961b971f Mon Sep 17 00:00:00 2001 From: Kai Moritz Date: Sat, 21 Dec 2019 13:34:32 +0100 Subject: [PATCH] Cart-Seite aus Tutorial implementiert --- src/app/cart/cart.component.html | 7 ++++++- src/app/cart/cart.component.ts | 6 +++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/app/cart/cart.component.html b/src/app/cart/cart.component.html index 6bdabc8..222ee9d 100644 --- a/src/app/cart/cart.component.html +++ b/src/app/cart/cart.component.html @@ -1 +1,6 @@ -

cart works!

+

Cart

+ +
+ {{ item.name }} + {{ item.price | currency }} +
diff --git a/src/app/cart/cart.component.ts b/src/app/cart/cart.component.ts index c9276d4..500bd05 100644 --- a/src/app/cart/cart.component.ts +++ b/src/app/cart/cart.component.ts @@ -1,4 +1,5 @@ import { Component, OnInit } from '@angular/core'; +import { CartService } from '../cart.service'; @Component({ selector: 'app-cart', @@ -7,9 +8,12 @@ import { Component, OnInit } from '@angular/core'; }) export class CartComponent implements OnInit { - constructor() { } + items; + + constructor(private cartService: CartService) { } ngOnInit() { + this.items = this.cartService.getItems(); } } -- 2.20.1