X-Git-Url: https://juplo.de/gitweb/?p=examples%2Fangular-tutorial;a=blobdiff_plain;f=src%2Fapp%2Fcart%2Fcart.component.ts;fp=src%2Fapp%2Fcart%2Fcart.component.ts;h=500bd05d33929be66be1dd900e357aa02600cf76;hp=c9276d4d36f3f2ccc25d981d94a778c051afcb6a;hb=6488b34b5f23a7372b3f9054e998a137961b971f;hpb=407dfe41df942c3079dee61e1fc1ed6094bb3bd5 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(); } }