feat(transaction-history): add transaction history feature with modal
This commit is contained in:
parent
d6077645d9
commit
9817fb95db
6 changed files with 57 additions and 12 deletions
|
@ -1,17 +1,35 @@
|
|||
import { ChangeDetectionStrategy, Component, inject } from '@angular/core';
|
||||
import { ChangeDetectionStrategy, Component, EventEmitter, inject, Input, Output } from '@angular/core';
|
||||
import { TransactionService } from '@service/transaction.service';
|
||||
import { Observable } from 'rxjs';
|
||||
import { Transaction } from '../../model/Transaction';
|
||||
import { AsyncPipe, CurrencyPipe, DatePipe, NgForOf, NgIf } from '@angular/common';
|
||||
import { AnimatedNumberComponent } from '@blackjack/components/animated-number/animated-number.component';
|
||||
|
||||
@Component({
|
||||
standalone: true,
|
||||
selector: 'app-transaction-history',
|
||||
imports: [],
|
||||
imports: [
|
||||
NgForOf,
|
||||
AsyncPipe,
|
||||
CurrencyPipe,
|
||||
DatePipe,
|
||||
AnimatedNumberComponent,
|
||||
NgIf,
|
||||
],
|
||||
templateUrl: './transaction-history.component.html',
|
||||
styleUrl: './transaction-history.component.css',
|
||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||
})
|
||||
export class TransactionHistoryComponent {
|
||||
@Input()
|
||||
isOpen: boolean = false;
|
||||
private transactionService: TransactionService = inject(TransactionService);
|
||||
@Output()
|
||||
closeEventEmitter = new EventEmitter<void>();
|
||||
transactions$: Observable<Transaction[]> = this.transactionService.getUsersTransactions();
|
||||
|
||||
transactions$: Observable<> = this.transactionService.getUsersTransactions();
|
||||
closeDialog() {
|
||||
this.isOpen = false;
|
||||
this.closeEventEmitter.emit();
|
||||
}
|
||||
}
|
||||
|
|
Reference in a new issue