added ion-grid to latest-transactions component

This commit is contained in:
Darren Nelsen 2017-08-21 18:00:39 -04:00
parent d4d5e500d6
commit 743c060463
3 changed files with 43 additions and 11 deletions

View File

@ -38,12 +38,10 @@
"devDependencies": {
"@angular/cli": "1.1.2",
"@ionic/app-scripts": "1.3.7",
"@ionic/cli-plugin-cordova": "1.6.2",
"@ionic/cli-plugin-ionic-angular": "1.4.1",
"@types/jasmine": "2.5.41",
"@types/node": "7.0.4",
"codecov": "2.2.0",
"ionic": "3.9.1",
"ionic": "3.9.2",
"jasmine-core": "2.5.2",
"jasmine-spec-reporter": "3.2.0",
"karma": "1.4.1",

View File

@ -1,4 +1,25 @@
<!-- Generated template for the LatestTransactionsComponent component -->
<div>
{{text}}
<div *ngIf="loading">
<ion-spinner name="crescent"></ion-spinner>
</div>
<div *ngIf="!loading">
<ion-grid>
<ion-row>
<ion-col><b>Hash</b></ion-col>
<ion-col text-right><b>Value Out</b></ion-col>
</ion-row>
<ion-row *ngFor="let tx of getTransactions()">
<ion-col>
<a (click)="goToTransaction(tx.hash)">{{ tx.hash }}</a>
</ion-col>
<ion-col text-right>
{{ currency.getConversion(tx.out) }}
</ion-col>
</ion-row>
</ion-grid>
</div>
</div>

View File

@ -1,6 +1,7 @@
import { Component } from '@angular/core';
// import { Http } from '@angular/http';
// import { ApiProvider } from '../../providers/api/api';
import { CurrencyProvider } from '../../providers/currency/currency';
/**
* Generated class for the LatestTransactionsComponent component.
@ -14,15 +15,23 @@ import { Component } from '@angular/core';
})
export class LatestTransactionsComponent {
private text: string;
// private loading: boolean = true;
private transactions: Array<any> = [
{
hash: '12345',
out: 0.001
},
{
hash: '22345',
out: 0.002
}
];
constructor(/*private http: Http, private api: ApiProvider*/) {
console.log('Hello LatestTransactionsComponent Component');
this.text = 'Hello Latest Transactions';
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.queryType + '=' + this.queryValue;
this.http.get(url).subscribe(
(data) => {
this.transactions = JSON.parse(data['_body']);
@ -49,4 +58,8 @@ export class LatestTransactionsComponent {
*/
}
public getTransactions(): Array<any> {
return this.transactions;
}
}