Online-Shop/src/app/cart/cart.component.ts

22 lines
525 B
TypeScript
Raw Normal View History

import { Component } from '@angular/core';
import { CartService } from '../cart.service';
import { Product } from '../products';
import { CurrencyPipe } from '@angular/common';
@Component({
selector: 'app-cart',
standalone: true,
imports: [CurrencyPipe],
templateUrl: './cart.component.html',
styleUrl: './cart.component.css'
})
export class CartComponent {
items: Product[] | undefined = undefined;
constructor(
private cartService: CartService,
) {
this.items = this.cartService.getItems();
}
}