Cart-Seite aus Tutorial implementiert
[examples/angular-tutorial] / src / app / cart / cart.component.ts
index c9276d4..500bd05 100644 (file)
@@ -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();
   }
 
 }