From 8a1d8e6df214bb6dec00f1a0c571d593d04fbd5b Mon Sep 17 00:00:00 2001 From: Darren Nelsen Date: Tue, 22 Aug 2017 13:30:01 -0400 Subject: [PATCH] pull in transactions from new endpoint --- .../latest-transactions.ts | 37 ++++--------------- 1 file changed, 7 insertions(+), 30 deletions(-) diff --git a/app/src/components/latest-transactions/latest-transactions.ts b/app/src/components/latest-transactions/latest-transactions.ts index 5b65217..6740f72 100644 --- a/app/src/components/latest-transactions/latest-transactions.ts +++ b/app/src/components/latest-transactions/latest-transactions.ts @@ -1,6 +1,6 @@ import { Component } from '@angular/core'; -// import { Http } from '@angular/http'; -// import { ApiProvider } from '../../providers/api/api'; +import { Http } from '@angular/http'; +import { ApiProvider } from '../../providers/api/api'; import { CurrencyProvider } from '../../providers/currency/currency'; /** @@ -15,26 +15,17 @@ import { CurrencyProvider } from '../../providers/currency/currency'; }) export class LatestTransactionsComponent { - // private loading: boolean = true; - private transactions: Array = [ - { - hash: '12345', - out: 0.001 - }, - { - hash: '22345', - out: 0.002 - } - ]; + private loading: boolean = true; + private transactions: Array = []; - constructor(/*private http: Http, private api: ApiProvider*/ public currency: CurrencyProvider) { + constructor(private http: Http, private api: ApiProvider, public currency: CurrencyProvider) { - // let url: string = this.api.apiPrefix + 'txs'; + let url: string = this.api.apiPrefix + 'txs'; - /* this.http.get(url).subscribe( (data) => { this.transactions = JSON.parse(data['_body']); + console.log('this.transactions', this.transactions); this.loading = false; }, (err) => { @@ -42,20 +33,6 @@ export class LatestTransactionsComponent { this.loading = false; } ); - */ - - /* - this.http.get(this.api.apiPrefix + 'tx/' + this.txId).subscribe( - (data) => { - this.tx = JSON.parse(data['_body']); - this.loading = false; - }, - (err) => { - console.log('err is', err); - this.loading = false; - } - ); - */ } public getTransactions(): Array {