génération du provider, WIP
This commit is contained in:
parent
04c33a9738
commit
dc9280f825
|
@ -12,6 +12,7 @@ import { ContactsPage } from "../pages/contacts/contacts";
|
||||||
import { SendPage} from "../pages/send/send";
|
import { SendPage} from "../pages/send/send";
|
||||||
import { TransactionsPage} from "../pages/transactions/transactions";
|
import { TransactionsPage} from "../pages/transactions/transactions";
|
||||||
import { SearchPage } from "../pages/search/search";
|
import { SearchPage } from "../pages/search/search";
|
||||||
|
import { GitsonProvider } from '../providers/gitson/gitson';
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
declarations: [
|
declarations: [
|
||||||
|
@ -42,7 +43,8 @@ import { SearchPage } from "../pages/search/search";
|
||||||
providers: [
|
providers: [
|
||||||
StatusBar,
|
StatusBar,
|
||||||
SplashScreen,
|
SplashScreen,
|
||||||
{provide: ErrorHandler, useClass: IonicErrorHandler}
|
{provide: ErrorHandler, useClass: IonicErrorHandler},
|
||||||
|
GitsonProvider,
|
||||||
]
|
]
|
||||||
})
|
})
|
||||||
export class AppModule {}
|
export class AppModule {}
|
||||||
|
|
|
@ -2,6 +2,7 @@ import { Component } from '@angular/core';
|
||||||
import { IonicPage, NavController, NavParams } from 'ionic-angular';
|
import { IonicPage, NavController, NavParams } from 'ionic-angular';
|
||||||
import { HomePage } from '../home/home';
|
import { HomePage } from '../home/home';
|
||||||
import { AlertController } from 'ionic-angular';
|
import { AlertController } from 'ionic-angular';
|
||||||
|
import { GitsonProvider } from '../../providers/gitson/gitson';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Generated class for the LoginPage page.
|
* Generated class for the LoginPage page.
|
||||||
|
@ -17,7 +18,7 @@ import { AlertController } from 'ionic-angular';
|
||||||
})
|
})
|
||||||
export class LoginPage {
|
export class LoginPage {
|
||||||
|
|
||||||
constructor(public navCtrl: NavController, public navParams: NavParams, public alertCtrl: AlertController) {
|
constructor(public navCtrl: NavController, public navParams: NavParams, public alertCtrl: AlertController, private gitsonService: GitsonProvider) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -27,6 +28,7 @@ export class LoginPage {
|
||||||
|
|
||||||
validLogin($username, $password) {
|
validLogin($username, $password) {
|
||||||
if ($username === "test" && $password === "test") {
|
if ($username === "test" && $password === "test") {
|
||||||
|
|
||||||
this.navCtrl.setRoot(HomePage);
|
this.navCtrl.setRoot(HomePage);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
21
src/providers/gitson/gitson.ts
Normal file
21
src/providers/gitson/gitson.ts
Normal 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");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
Loading…
Reference in a new issue