22 lines
525 B
TypeScript
22 lines
525 B
TypeScript
|
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();
|
||
|
}
|
||
|
}
|