Correction Transaction test
Affichage de l'historique de transaction avec quelques variables de test
This commit is contained in:
parent
3e907cf5f2
commit
bcd5d2330a
|
@ -3,4 +3,5 @@ export class Transaction {
|
||||||
to: string
|
to: string
|
||||||
amount: number
|
amount: number
|
||||||
timestamp: number
|
timestamp: number
|
||||||
|
date: string
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,7 +18,13 @@
|
||||||
<ion-item *ngFor="let transactionTest of listTransactions">
|
<ion-item *ngFor="let transactionTest of listTransactions">
|
||||||
<ion-card>
|
<ion-card>
|
||||||
<ion-card-content>
|
<ion-card-content>
|
||||||
{{transactionTest}}
|
From : {{transactionTest.from}}
|
||||||
|
<br>
|
||||||
|
To : {{transactionTest.to}}
|
||||||
|
<br>
|
||||||
|
Amount : {{transactionTest.amount}}
|
||||||
|
<br>
|
||||||
|
Date : {{transactionTest.date}}
|
||||||
</ion-card-content>
|
</ion-card-content>
|
||||||
</ion-card>
|
</ion-card>
|
||||||
</ion-item>
|
</ion-item>
|
||||||
|
|
|
@ -15,8 +15,9 @@ import {Transaction} from "../../app/models/Transaction";
|
||||||
templateUrl: 'transactions.html',
|
templateUrl: 'transactions.html',
|
||||||
})
|
})
|
||||||
export class TransactionsPage {
|
export class TransactionsPage {
|
||||||
listTransactions:Array<Transaction>;
|
listTransactions = [];
|
||||||
transactionTest:Transaction;
|
transactionTest = new Transaction();
|
||||||
|
transactionTest2 = new Transaction();
|
||||||
|
|
||||||
constructor(public navCtrl: NavController, public navParams: NavParams) {
|
constructor(public navCtrl: NavController, public navParams: NavParams) {
|
||||||
|
|
||||||
|
@ -32,9 +33,18 @@ export class TransactionsPage {
|
||||||
this.transactionTest.to="tata";
|
this.transactionTest.to="tata";
|
||||||
this.transactionTest.amount=200;
|
this.transactionTest.amount=200;
|
||||||
this.transactionTest.timestamp=1539600000;
|
this.transactionTest.timestamp=1539600000;
|
||||||
|
this.transactionTest.date= new Date(this.transactionTest.timestamp*1000).toDateString()
|
||||||
|
|
||||||
this.listTransactions.push(this.transactionTest);
|
this.listTransactions.push(this.transactionTest);
|
||||||
|
|
||||||
|
this.transactionTest2.from="tata";
|
||||||
|
this.transactionTest2.to="toto";
|
||||||
|
this.transactionTest2.amount=40;
|
||||||
|
this.transactionTest2.timestamp=1539900000;
|
||||||
|
this.transactionTest2.date= new Date(this.transactionTest2.timestamp*1000).toDateString()
|
||||||
|
|
||||||
|
this.listTransactions.push(this.transactionTest2);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue