added call to new txs endpoint; changed html to reflect txid and valueOut in transactions grid

This commit is contained in:
Darren Nelsen 2017-08-22 14:34:24 -04:00
parent b9de71862d
commit 9848b17fc1
2 changed files with 9 additions and 7 deletions

View File

@ -11,12 +11,12 @@
<ion-col text-right><b>Value Out</b></ion-col>
</ion-row>
<ion-row *ngFor="let tx of getTransactions()">
<ion-row *ngFor="let tx of transactions">
<ion-col>
<a (click)="goToTransaction(tx.hash)">{{ tx.hash }}</a>
<a (click)="goToTx(tx.txid)">{{ tx.txid }}</a>
</ion-col>
<ion-col text-right>
{{ currency.getConversion(tx.out) }}
{{ currency.getConversion(tx.valueOut) }}
</ion-col>
</ion-row>

View File

@ -1,5 +1,6 @@
import { Component } from '@angular/core';
import { Http } from '@angular/http';
import { NavController } from 'ionic-angular';
import { ApiProvider } from '../../providers/api/api';
import { CurrencyProvider } from '../../providers/currency/currency';
@ -18,7 +19,7 @@ export class LatestTransactionsComponent {
private loading: boolean = true;
private transactions: Array<any> = [];
constructor(private http: Http, private api: ApiProvider, public currency: CurrencyProvider) {
constructor(private http: Http, private navCtrl: NavController, private api: ApiProvider, public currency: CurrencyProvider) {
let url: string = this.api.apiPrefix + 'txs';
@ -35,8 +36,9 @@ export class LatestTransactionsComponent {
);
}
public getTransactions(): Array<any> {
return this.transactions;
public goToTx(txId: string): void {
this.navCtrl.push('transaction', {
'txId': txId
});
}
}