Compare commits

...

20 commits
master ... matt

Author SHA1 Message Date
Matt Marcha dc9280f825 génération du provider, WIP 2018-11-08 14:24:32 +01:00
Matt Marcha 04c33a9738 Merge branch 'matt' into dev 2018-11-08 11:48:53 +01:00
GME 57bd7d141a Merge branch 'guillaume' into dev 2018-11-08 11:47:59 +01:00
Matt Marcha 7bf21d6992 Historique de transactions 2018-11-08 11:44:50 +01:00
GME d03fcc8dd1 Update -
Transactions, Contact, Search, Home
2018-11-08 11:40:53 +01:00
Matt Marcha d93e9dfabf Page achat de monnaie 2018-11-08 11:30:28 +01:00
GME bcd5d2330a Correction Transaction test
Affichage de l'historique de transaction avec quelques variables de test
2018-11-08 09:58:09 +01:00
GME 3e907cf5f2 Merge branch 'matt' into guillaume 2018-11-08 09:34:35 +01:00
GME ed777afc54 Prout 2018-11-08 09:17:52 +01:00
Matt Marcha 96cf776642 corrections mineures 2018-11-08 09:16:45 +01:00
Matt Marcha 5a4237ec81 Remplissage des pages 2018-10-19 17:00:53 +02:00
GME e68cfcbf20 Merge branch 'matt' of https://github.com/Aveias/mobilapp into guillaume 2018-10-19 16:47:48 +02:00
GME a0ce13e23f json test and modification to disconnect button 2018-10-19 16:33:38 +02:00
Matt Marcha 10cae386cf Ébauche des modèles user et transaction 2018-10-19 16:21:52 +02:00
GME01 f69e821f35
Merge pull request #1 from Aveias/dev
Merge develop in guillaume
2018-10-19 15:07:33 +02:00
Matt Marcha 6d61399672 Résolution du conflit push de guillaume sur branch matt 2018-10-19 14:59:29 +02:00
Matt Marcha d9dea089e4 Formulaire de login et redirection vers page accueil 2018-10-19 14:48:33 +02:00
GME 94a7966d08 LinkPages
Link to pages with disconnect in homepage
2018-10-19 14:34:54 +02:00
Matt Marcha c3fe53e3e7 Première navigation lgin to home 2018-10-19 12:17:59 +02:00
Matt Marcha bd7264f111 Génération des pages 2018-10-19 11:09:06 +02:00
34 changed files with 2043 additions and 1158 deletions

2300
package-lock.json generated

File diff suppressed because it is too large Load diff

55
resources/raw/config.json Normal file
View file

@ -0,0 +1,55 @@
{
"users":[
{
"name": "Test",
"firstName":"Toto",
"email": "toto@mail.com",
"password": "totopwd",
"balance": 500.0,
"lastTransactions": [
{
"from":"toto@mail.com",
"to": "bic@mail.com",
"amount": 10.0,
"timestamp": 1539861600
}
]
},
{
"name": "lePen",
"firstName":"Bic",
"email": "bic@mail.com",
"password": "bicpwd",
"balance": 10.0,
"lastTransactions": [
{
"from": "toto@mail.com",
"to": "bic@mail.com",
"amount": 10.0,
"timestamp": 1539861900
},
{
"from":"bic@mail.com",
"to":"tata@mail.com",
"amount": 200.0,
"timestamp": 1539600000
}
]
},
{
"name": "tata",
"firstName":"",
"email": "tata@mail.com",
"password": "tataPwd",
"balance": 235.0,
"lastTransactions": [
{
"from":"bic@mail.com",
"to": "tata@mail.com",
"amount": 200,
"timestamp": 1539601200
}
]
}
]
}

View file

@ -3,12 +3,12 @@ import { Platform } from 'ionic-angular';
import { StatusBar } from '@ionic-native/status-bar';
import { SplashScreen } from '@ionic-native/splash-screen';
import { HomePage } from '../pages/home/home';
import { LoginPage } from '../pages/login/login';
@Component({
templateUrl: 'app.html'
})
export class MyApp {
rootPage:any = HomePage;
rootPage:any = LoginPage;
constructor(platform: Platform, statusBar: StatusBar, splashScreen: SplashScreen) {
platform.ready().then(() => {

View file

@ -6,11 +6,24 @@ import { StatusBar } from '@ionic-native/status-bar';
import { MyApp } from './app.component';
import { HomePage } from '../pages/home/home';
import { LoginPage } from '../pages/login/login';
import { BuyPage } from '../pages/buy/buy';
import { ContactsPage } from "../pages/contacts/contacts";
import { SendPage} from "../pages/send/send";
import { TransactionsPage} from "../pages/transactions/transactions";
import { SearchPage } from "../pages/search/search";
import { GitsonProvider } from '../providers/gitson/gitson';
@NgModule({
declarations: [
MyApp,
HomePage
HomePage,
LoginPage,
BuyPage,
ContactsPage,
SendPage,
TransactionsPage,
SearchPage
],
imports: [
BrowserModule,
@ -19,12 +32,19 @@ import { HomePage } from '../pages/home/home';
bootstrap: [IonicApp],
entryComponents: [
MyApp,
HomePage
HomePage,
LoginPage,
BuyPage,
ContactsPage,
SendPage,
TransactionsPage,
SearchPage
],
providers: [
StatusBar,
SplashScreen,
{provide: ErrorHandler, useClass: IonicErrorHandler}
{provide: ErrorHandler, useClass: IonicErrorHandler},
GitsonProvider,
]
})
export class AppModule {}

View file

@ -0,0 +1,7 @@
export class Transaction {
from: string
to: string
amount: number
timestamp: number
date: string
}

9
src/app/models/User.ts Normal file
View file

@ -0,0 +1,9 @@
import { Transaction } from "./Transaction";
export class User {
name: string
firstName: string
email: string
balance: number
lastTransactions: Array<Transaction>
}

68
src/pages/buy/buy.html Normal file
View file

@ -0,0 +1,68 @@
<!--
Generated template for the BuyPage page.
See http://ionicframework.com/docs/components/#navigation for more info on
Ionic pages and navigation.
-->
<ion-header>
<ion-navbar>
<ion-title>Échange de monnaie</ion-title>
</ion-navbar>
</ion-header>
<ion-content padding>
<ion-list>
<ion-item>
<ion-label stacked>Montant</ion-label>
<ion-input [(ngModel)]="amount" name="amount" type="number" value="10"></ion-input>
</ion-item>
<ion-item>
<ion-label stacked>N° de carte</ion-label>
<ion-input [(ngModel)]="cardnumber" name="cardnumber" type="number" min="0000000000000000" max="9999999999999999"></ion-input>
</ion-item>
<ion-item>
<ion-label stacked>Titulaire de la carte</ion-label>
<ion-input type="text"></ion-input>
</ion-item>
<ion-grid>
<ion-row class="cb-date">
<ion-col col-5>
<ion-item>
<ion-label stacked>Date d'expiration</ion-label>
<ion-input [(ngModel)]="mounth" name="mounth" type="number" min="1" max="12"></ion-input>
</ion-item>
</ion-col>
</ion-row>
<ion-row>
<ion-col col-2> / </ion-col>
</ion-row>
<ion-row>
<ion-col col-5>
<ion-item>
<ion-input [(ngModel)]="year" name="year" type="number"></ion-input>
</ion-item>
</ion-col>
</ion-row>
</ion-grid>
<ion-item>
<ion-label stacked>Cryptogramme</ion-label>
<ion-input [(ngModel)]="cryp" name="cryp" type="number" min="000" max="999"></ion-input>
</ion-item>
<button ion-button (click)="sendTransaction(cardnumber, mounth, year, cryp, amount)">Payer {{amount}} €</button>
</ion-list>
</ion-content>

View file

@ -0,0 +1,13 @@
import { NgModule } from '@angular/core';
import { IonicPageModule } from 'ionic-angular';
import { BuyPage } from './buy';
@NgModule({
declarations: [
BuyPage,
],
imports: [
IonicPageModule.forChild(BuyPage),
],
})
export class BuyPageModule {}

3
src/pages/buy/buy.scss Normal file
View file

@ -0,0 +1,3 @@
page-buy {
}

97
src/pages/buy/buy.ts Normal file
View file

@ -0,0 +1,97 @@
import { Component } from '@angular/core';
import { IonicPage, NavController, NavParams } from 'ionic-angular';
import { AlertController } from 'ionic-angular';
/**
* Generated class for the BuyPage page.
*
* See https://ionicframework.com/docs/components/#navigation for more info on
* Ionic pages and navigation.
*/
@IonicPage()
@Component({
selector: 'page-buy',
templateUrl: 'buy.html',
})
export class BuyPage {
constructor(public navCtrl: NavController, public navParams: NavParams, public alertCtrl: AlertController) {
}
ionViewDidLoad() {
console.log('ionViewDidLoad BuyPage');
}
sendTransaction($cardnumber, $month, $year, $cryp, $amount) {
if (typeof $cardnumber !== 'undefined' && typeof $month !== 'undefined' && typeof $year !== 'undefined' && typeof $cryp !== 'undefined' && typeof $amount !== 'undefined' ) {
if (this.checkFields($cardnumber, $month, $year, $cryp)) {
//TODO : Contacter l'API et proposer la transaction. L'API répondra true ou False
if (true === true) {
this.navCtrl.popToRoot();
}
else {
const alert = this.alertCtrl.create({
title: 'Erreur',
subTitle: 'La transaction a échoué. Vérifiez les données saisies et réessayez.',
buttons: ['OK']
});
alert.present();
}
}
}
else {
const alert = this.alertCtrl.create({
title: 'Champs vides',
subTitle: 'Merci de remplir tous les champs',
buttons: ['OK']
});
alert.present();
}
}
//Vérification des champs
checkFields(cardnumber, month, year, cryp) {
if (!this.checkCardInfoIntegrity(12, 19, cardnumber) || !this.checkCardInfoIntegrity(3, 4, cryp) || !this.checkCardInfoValue(0, 9999, cryp)) {
const alert = this.alertCtrl.create({
title: 'Erreur',
subTitle: 'Le numéro de carte bancaire est erroné. Vérifiez les données et recommencez.',
buttons: ['OK']
});
alert.present();
return false;
}
else if (!this.checkCardInfoIntegrity(1, 2, month) || !this.checkCardInfoValue(1, 12, month) || !this.checkCardInfoIntegrity(4, 4, year) || !this.checkCardInfoValue(2018, 2050, year)) {
const alert = this.alertCtrl.create({
title: 'Erreur',
subTitle: 'La date est erronée. Vérifiez les données et recommencez.',
buttons: ['OK']
});
alert.present();
return false;
}
else {
return true;
}
}
checkCardInfoIntegrity($min, $max, $number) {
$number = parseInt($number);
if ($number.length < $min || $number.length > $max) {
return false;
}
else {
return true;
}
}
checkCardInfoValue($min, $max, $number) {
$number = parseInt($number);
if ($number < $min || $number > $max) {
return false;
}
else {
return true;
}
}
}

View file

@ -0,0 +1,39 @@
<!--
Generated template for the ContactsPage page.
See http://ionicframework.com/docs/components/#navigation for more info on
Ionic pages and navigation.
-->
<ion-header>
<ion-navbar>
<ion-title>contacts</ion-title>
</ion-navbar>
</ion-header>
<ion-content padding>
<ion-card (click)="selectContact('tata')">
<ion-card-content>
Name : tata
<br>
Address : 75438973HJFBSDFZ989024
</ion-card-content>
</ion-card>
<ion-card (click)="selectContact('test')">
<ion-card-content>
Name : test
<br>
Address : 754389IHGOERG989324JIJ
</ion-card-content>
</ion-card>
<ion-card (click)="selectContact('toaster')">
<ion-card-content>
Name : toaster
<br>
Address : 780U8GEOKNOKSQDU974328
</ion-card-content>
</ion-card>
</ion-content>

View file

@ -0,0 +1,13 @@
import { NgModule } from '@angular/core';
import { IonicPageModule } from 'ionic-angular';
import { ContactsPage } from './contacts';
@NgModule({
declarations: [
ContactsPage,
],
imports: [
IonicPageModule.forChild(ContactsPage),
],
})
export class ContactsPageModule {}

View file

@ -0,0 +1,3 @@
page-contacts {
}

View file

@ -0,0 +1,29 @@
import { Component } from '@angular/core';
import { IonicPage, NavController, NavParams } from 'ionic-angular';
/**
* Generated class for the ContactsPage page.
*
* See https://ionicframework.com/docs/components/#navigation for more info on
* Ionic pages and navigation.
*/
@IonicPage()
@Component({
selector: 'page-contacts',
templateUrl: 'contacts.html',
})
export class ContactsPage {
constructor(public navCtrl: NavController, public navParams: NavParams) {
}
ionViewDidLoad() {
console.log('ionViewDidLoad ContactsPage');
}
selectContact(contact) {
console.log('toto - '+contact)
}
}

View file

@ -1,14 +1,35 @@
<!--
Generated template for the HomePage page.
See http://ionicframework.com/docs/components/#navigation for more info on
Ionic pages and navigation.
-->
<ion-header>
<ion-navbar>
<ion-title>
Ionic Blank
</ion-title>
<ion-title>Mon compte</ion-title>
</ion-navbar>
</ion-header>
<ion-content padding>
The world is your oyster.
<p>
If you get lost, the <a href="http://ionicframework.com/docs/v2">docs</a> will be your guide.
</p>
<p class="welcome-text">Bonjour, François Pignon</p>
<ion-card>
<ion-card-header>
Solde actuel
</ion-card-header>
<ion-card-content>
<p class="balance">567,38</p>
<p>Gonettes</p>
</ion-card-content>
</ion-card>
<ion-buttons>
<button ion-item (click)="changePage('contact')">Contacts</button>
<button ion-item (click)="changePage('buy')">Acheter de la monnaie locale</button>
<button ion-item (click)="changePage('send')">Faire un virement</button>
<button ion-item (click)="changePage('history')">Historique des transactions</button>
<button ion-item (click)="closeConnexion()">Se déconnecter</button>
</ion-buttons>
</ion-content>

View file

@ -0,0 +1,13 @@
import { NgModule } from '@angular/core';
import { IonicPageModule } from 'ionic-angular';
import { HomePage } from './home';
@NgModule({
declarations: [
HomePage,
],
imports: [
IonicPageModule.forChild(HomePage),
],
})
export class HomePageModule {}

View file

@ -1,14 +1,55 @@
import { Component } from '@angular/core';
import { NavController } from 'ionic-angular';
import { IonicPage, NavController, NavParams } from 'ionic-angular';
import { BuyPage } from '../buy/buy';
import { ContactsPage } from '../contacts/contacts';
import {SendPage} from "../send/send";
import {TransactionsPage} from "../transactions/transactions";
import {LoginPage} from "../login/login";
/**
* Generated class for the HomePage page.
*
* See https://ionicframework.com/docs/components/#navigation for more info on
* Ionic pages and navigation.
*/
@IonicPage()
@Component({
selector: 'page-home',
templateUrl: 'home.html'
templateUrl: 'home.html',
})
export class HomePage {
constructor(public navCtrl: NavController) {
constructor(public navCtrl: NavController, public navParams: NavParams) {
}
ionViewDidLoad() {
console.log('ionViewDidLoad HomePage');
}
changePage(params) {
switch (params) {
case 'buy': {
this.navCtrl.push(BuyPage);
break;
}
case 'contact':{
this.navCtrl.push(ContactsPage);
break;
}
case 'send':{
this.navCtrl.push(SendPage);
break;
}
case 'history':{
this.navCtrl.push(TransactionsPage);
break;
}
}
}
closeConnexion(){
this.navCtrl.setRoot(LoginPage);
}
}

View file

@ -0,0 +1,34 @@
<!--
Generated template for the LoginPage page.
See http://ionicframework.com/docs/components/#navigation for more info on
Ionic pages and navigation.
-->
<ion-header>
<ion-navbar>
<ion-title>login</ion-title>
</ion-navbar>
</ion-header>
<ion-content padding>
<ion-list>
<ion-item>
<ion-label stacked>Identifiant</ion-label>
<ion-input [(ngModel)]="username" name="username" type="text"></ion-input>
</ion-item>
<ion-item>
<ion-label stacked>Mot de passe</ion-label>
<ion-input [(ngModel)]="password" name="password" type="password"></ion-input>
</ion-item>
</ion-list>
<button ion-button (click)="validLogin(username, password)">Connexion</button>
</ion-content>

View file

@ -0,0 +1,13 @@
import { NgModule } from '@angular/core';
import { IonicPageModule } from 'ionic-angular';
import { LoginPage } from './login';
@NgModule({
declarations: [
LoginPage,
],
imports: [
IonicPageModule.forChild(LoginPage),
],
})
export class LoginPageModule {}

View file

@ -0,0 +1,3 @@
page-login {
}

44
src/pages/login/login.ts Normal file
View file

@ -0,0 +1,44 @@
import { Component } from '@angular/core';
import { IonicPage, NavController, NavParams } from 'ionic-angular';
import { HomePage } from '../home/home';
import { AlertController } from 'ionic-angular';
import { GitsonProvider } from '../../providers/gitson/gitson';
/**
* Generated class for the LoginPage page.
*
* See https://ionicframework.com/docs/components/#navigation for more info on
* Ionic pages and navigation.
*/
@IonicPage()
@Component({
selector: 'page-login',
templateUrl: 'login.html',
})
export class LoginPage {
constructor(public navCtrl: NavController, public navParams: NavParams, public alertCtrl: AlertController, private gitsonService: GitsonProvider) {
}
ionViewDidLoad() {
console.log('ionViewDidLoad LoginPage');
}
validLogin($username, $password) {
if ($username === "test" && $password === "test") {
this.navCtrl.setRoot(HomePage);
}
else {
const alert = this.alertCtrl.create({
title: 'Erreur',
subTitle: 'Identifiant ou mot de passe erroné. Veuillez réessayer.',
buttons: ['OK']
});
alert.present();
}
}
}

View file

@ -0,0 +1,26 @@
<!--
Generated template for the SearchPage page.
See http://ionicframework.com/docs/components/#navigation for more info on
Ionic pages and navigation.
-->
<ion-header>
<ion-navbar>
<ion-title>search</ion-title>
</ion-navbar>
</ion-header>
<ion-content padding>
<ion-list>
<ion-item>
<ion-label stacked>Recipient</ion-label>
<ion-input [(ngModel)]="user" name="recipient" type="text"></ion-input>
</ion-item>
<br>
<button ion-button (click)="searchUser(user)">Rechercher</button>
</ion-list>
</ion-content>

View file

@ -0,0 +1,13 @@
import { NgModule } from '@angular/core';
import { IonicPageModule } from 'ionic-angular';
import { SearchPage } from './search';
@NgModule({
declarations: [
SearchPage,
],
imports: [
IonicPageModule.forChild(SearchPage),
],
})
export class SearchPageModule {}

View file

@ -0,0 +1,3 @@
page-search {
}

View file

@ -0,0 +1,29 @@
import { Component } from '@angular/core';
import { IonicPage, NavController, NavParams } from 'ionic-angular';
/**
* Generated class for the SearchPage page.
*
* See https://ionicframework.com/docs/components/#navigation for more info on
* Ionic pages and navigation.
*/
@IonicPage()
@Component({
selector: 'page-search',
templateUrl: 'search.html',
})
export class SearchPage {
constructor(public navCtrl: NavController, public navParams: NavParams) {
}
ionViewDidLoad() {
console.log('ionViewDidLoad SearchPage');
}
searchUser($user){
console.log('prout')
}
}

34
src/pages/send/send.html Normal file
View file

@ -0,0 +1,34 @@
<!--
Generated template for the SendPage page.
See http://ionicframework.com/docs/components/#navigation for more info on
Ionic pages and navigation.
-->
<ion-header>
<ion-navbar>
<ion-title>Effectuer un virement</ion-title>
</ion-navbar>
</ion-header>
<ion-content padding>
<ion-list>
<button ion-button (click)="changePage('contact')">Contacts</button>
<button ion-button (click)="changePage('search')">Chercher un contact</button>
<ion-item>
<ion-label stacked>Recipient</ion-label>
<ion-input [(ngModel)]="recipient" name="recipient" type="text"></ion-input>
</ion-item>
<ion-item>
<ion-label stacked>Montant</ion-label>
<ion-input [(ngModel)]="amount" name="amount" type="number" value="10"></ion-input>
</ion-item>
<button ion-button (click)="t">Envoyer</button>
</ion-list>
</ion-content>

View file

@ -0,0 +1,13 @@
import { NgModule } from '@angular/core';
import { IonicPageModule } from 'ionic-angular';
import { SendPage } from './send';
@NgModule({
declarations: [
SendPage,
],
imports: [
IonicPageModule.forChild(SendPage),
],
})
export class SendPageModule {}

3
src/pages/send/send.scss Normal file
View file

@ -0,0 +1,3 @@
page-send {
}

40
src/pages/send/send.ts Normal file
View file

@ -0,0 +1,40 @@
import { Component } from '@angular/core';
import { IonicPage, NavController, NavParams } from 'ionic-angular';
import {SearchPage} from "../search/search";
import {ContactsPage} from "../contacts/contacts";
/**
* Generated class for the SendPage page.
*
* See https://ionicframework.com/docs/components/#navigation for more info on
* Ionic pages and navigation.
*/
@IonicPage()
@Component({
selector: 'page-send',
templateUrl: 'send.html',
})
export class SendPage {
constructor(public navCtrl: NavController, public navParams: NavParams) {
}
ionViewDidLoad() {
console.log('ionViewDidLoad SendPage');
}
changePage(params) {
switch (params) {
case 'search':{
this.navCtrl.push(SearchPage);
break;
}
case 'contact':{
this.navCtrl.push(ContactsPage);
break;
}
}
}
}

View file

@ -0,0 +1,97 @@
<!--
Generated template for the TransactionsPage page.
See http://ionicframework.com/docs/components/#navigation for more info on
Ionic pages and navigation.
-->
<ion-header>
<ion-navbar>
<ion-title>Dernières transactions</ion-title>
</ion-navbar>
</ion-header>
<ion-content padding>
<ion-list>
<ion-item *ngFor="let transactionTest of listTransactions">
<ion-card>
<ion-card-content>
From : {{transactionTest.from}}
<br>
Amount : {{transactionTest.amount}}
<br>
Date : {{transactionTest.date}}
</ion-card-content>
</ion-card>
</ion-item>
</ion-list>
<ion-card>
<ion-item>
<h2>Virement reçu</h2>
</ion-item>
<ion-card-content>
<p>Date : 2 novembre 2018</p>
<p>De : Jean-Charles DUTROU</p>
<p>Montant : 45 G</p>
</ion-card-content>
</ion-card>
<ion-card>
<ion-item>
<h2>Virement émis</h2>
</ion-item>
<ion-card-content>
<p>Date : 31 octobre 2018 13:30:03</p>
<p>À : Docteur FREUD</p>
<p>Montant : 150 G</p>
</ion-card-content>
</ion-card>
<ion-card>
<ion-item>
<h2>Paiement</h2>
</ion-item>
<ion-card-content>
<p>Date : 30 novembre 2018 22:12:35</p>
<p>À : Bar de la CUITTHE</p>
<p>Montant : 5 G</p>
</ion-card-content>
</ion-card>
<ion-card>
<ion-item>
<h2>Paiement</h2>
</ion-item>
<ion-card-content>
<p>Date : 30 novembre 2018 21:23:35</p>
<p>À : Bar de la CUITTHE</p>
<p>Montant : 5 G</p>
</ion-card-content>
</ion-card>
<ion-card>
<ion-item>
<h2>Paiement</h2>
</ion-item>
<ion-card-content>
<p>Date : 30 novembre 2018 20:45:35</p>
<p>À : Bar de la CUITTHE</p>
<p>Montant : 5 G</p>
</ion-card-content>
</ion-card>
</ion-content>

View file

@ -0,0 +1,13 @@
import { NgModule } from '@angular/core';
import { IonicPageModule } from 'ionic-angular';
import { TransactionsPage } from './transactions';
@NgModule({
declarations: [
TransactionsPage,
],
imports: [
IonicPageModule.forChild(TransactionsPage),
],
})
export class TransactionsPageModule {}

View file

@ -0,0 +1,3 @@
page-transactions {
}

View file

@ -0,0 +1,51 @@
import { Component } from '@angular/core';
import { IonicPage, NavController, NavParams } from 'ionic-angular';
import {Transaction} from "../../app/models/Transaction";
/**
* Generated class for the TransactionsPage page.
*
* See https://ionicframework.com/docs/components/#navigation for more info on
* Ionic pages and navigation.
*/
@IonicPage()
@Component({
selector: 'page-transactions',
templateUrl: 'transactions.html',
})
export class TransactionsPage {
listTransactions = [];
transactionTest = new Transaction();
transactionTest2 = new Transaction();
constructor(public navCtrl: NavController, public navParams: NavParams) {
}
ionViewDidLoad() {
console.log('ionViewDidLoad TransactionsPage');
this.init();
}
init(){
this.transactionTest.from="toto";
this.transactionTest.to="tata";
this.transactionTest.amount=200;
this.transactionTest.timestamp=1539600000;
this.transactionTest.date= new Date(this.transactionTest.timestamp*1000).toDateString()
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);
}
}

View file

@ -0,0 +1,21 @@
import { HttpClient } from '@angular/common/http';
import { Injectable } from '@angular/core';
import 'rxjs/add/operator/map';
/*
Generated class for the GitsonProvider provider.
See https://angular.io/guide/dependency-injection for more info on providers
and Angular DI.
*/
@Injectable()
export class GitsonProvider {
apiUrl ="https://raw.githubusercontent.com/Aveias/mobilapp/dev/resources/raw/config.json";
constructor(public http: HttpClient) {
console.log('Hello GitsonProvider Provider');
this.http.get("https://raw.githubusercontent.com/Aveias/mobilapp/dev/resources/raw/config.json");
}
}