Commit 9dc6941a authored by dev0tion's avatar dev0tion

Add transaction history

parent f4030dc4
<h1>History</h1>
\ No newline at end of file
<h1>History</h1>
<table *ngIf="transactions">
<thead>
<th>Timestamp</th>
<th>Amount</th>
<th>Confirmed</th>
<th>Transaction ID</th>
</thead>
<tr *ngFor="let transaction of transactions">
<td>{{ transaction.timestamp }}</td>
<td>{{ transaction.amount }}</td>
<td>{{ transaction.confirmed }}</td>
<td>{{ transaction.txid }}</td>
</tr>
</table>
\ No newline at end of file
import { Component } from '@angular/core';
import { Component, OnInit } from '@angular/core';
import { ApiService } from '../../shared/api/api.service'
@Component({
selector: 'history-component',
......@@ -7,5 +9,21 @@ import { Component } from '@angular/core';
})
export class HistoryComponent {
constructor(private apiService: ApiService) {}
private transactions: any;
private errorMessage: string;
ngOnInit() {
this.getWalletHistory();
}
private getWalletHistory() {
this.apiService.getWalletHistory()
.subscribe(
response => this.transactions = response.history,
error => this.errorMessage = <any>error,
() => console.log(this.transactions)
);
}
}
......@@ -25,8 +25,6 @@ export class DashboardComponent {
error => this.errorMessage = <any>error,
() => this.setBalance()
);
}
private setBalance() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment