added transaction and address search to blocksPage

This commit is contained in:
Darren Nelsen 2017-08-03 17:58:11 -04:00
parent 8a0d065296
commit c1523966f8
2 changed files with 12 additions and 8 deletions

View File

@ -30,10 +30,6 @@ export class TransactionListComponent {
(data) => {
this.transactions = JSON.parse(data['_body']);
this.loading = false;
this.transactions.txs.forEach((tx) => {
console.log('tx is', tx);
});
},
(err) => {
console.log('err is', err);

View File

@ -37,16 +37,24 @@ export class BlocksPage {
},
() => {
this.http.get(apiPrefix + 'tx/' + this.q).subscribe(
(data: any) => {
function (data: any) {
this.resetSearch();
console.log('tx', data);
},
let parsedData: any = JSON.parse(data._body);
this.navCtrl.push('transaction', {
'txId': parsedData.txid
});
}.bind(this),
() => {
this.http.get(apiPrefix + 'addr/' + this.q).subscribe(
(data: any) => {
function (data: any) {
this.resetSearch();
console.log('addr', data);
},
let parsedData: any = JSON.parse(data._body);
this.navCtrl.push('address', {
'addrStr': parsedData.addrStr
});
}.bind(this),
() => {
this.http.get(apiPrefix + 'block-index/' + this.q).subscribe(
function (data: any): void {