Added ability to read Transactions from server
This commit is contained in:
parent
00d713fff0
commit
2e27e7a43b
8 changed files with 160 additions and 4 deletions
21
src/app/shared/transaction-result.component.ts
Normal file
21
src/app/shared/transaction-result.component.ts
Normal file
|
@ -0,0 +1,21 @@
|
|||
import { Component, OnInit, Input, Output, EventEmitter } from '@angular/core';
|
||||
import * as moment from 'moment';
|
||||
|
||||
interface TransactionData {
|
||||
seller: number;
|
||||
value: string;
|
||||
purchase_time: string;
|
||||
}
|
||||
|
||||
@Component({
|
||||
selector: '[transaction-result]',
|
||||
templateUrl: 'transaction-result.component.html',
|
||||
})
|
||||
export class TransactionResultComponent implements OnInit {
|
||||
@Input() public transaction: TransactionData;
|
||||
public transactionDate: string;
|
||||
|
||||
ngOnInit(): void {
|
||||
this.transactionDate = moment(this.transaction.purchase_time).format('llll');
|
||||
}
|
||||
}
|
Reference in a new issue