From 0e01e5943b850b5eef259cbc37260d7a01c8ce31 Mon Sep 17 00:00:00 2001 From: Daniel Sogl Date: Tue, 30 May 2017 21:17:30 +0200 Subject: [PATCH 1/3] refactor(app.component.ts) unified templates --- src/app/app.component.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/app/app.component.ts b/src/app/app.component.ts index 1615934..355dfb2 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -13,7 +13,7 @@ import { User } from '../providers/user'; templateUrl: 'app.html' }) export class MyApp { - rootPage:any = null; + rootPage: any = null; constructor(platform: Platform, statusBar: StatusBar, splashScreen: SplashScreen, user: User, public config: Config) { let globalActions = function() { @@ -22,14 +22,16 @@ export class MyApp { statusBar.styleDefault(); splashScreen.hide(); }; + } + ionViewDidLoad() { platform.ready().then(() => { user.isAuthenticated().then(() => { console.log('you are authenticated!'); this.rootPage = TabsPage; globalActions(); }).catch(() => { - console.log('you are not authenticated..'); + console.log('you are not authenticated..'); this.rootPage = LoginPage; globalActions(); }); From 5e8fabac5d95a9870314d33e9c1f91653046543c Mon Sep 17 00:00:00 2001 From: Daniel Sogl Date: Tue, 30 May 2017 21:29:14 +0200 Subject: [PATCH 2/3] Update app.component.ts --- src/app/app.component.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/app/app.component.ts b/src/app/app.component.ts index 355dfb2..3fbf46f 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -15,7 +15,7 @@ import { User } from '../providers/user'; export class MyApp { rootPage: any = null; - constructor(platform: Platform, statusBar: StatusBar, splashScreen: SplashScreen, user: User, public config: Config) { + constructor(private platform: Platform, private statusBar: StatusBar, private splashScreen: SplashScreen, private user: User, private config: Config) { let globalActions = function() { // Okay, so the platform is ready and our plugins are available. // Here you can do any higher level native things you might need. @@ -25,8 +25,8 @@ export class MyApp { } ionViewDidLoad() { - platform.ready().then(() => { - user.isAuthenticated().then(() => { + this.platform.ready().then(() => { + this.user.isAuthenticated().then(() => { console.log('you are authenticated!'); this.rootPage = TabsPage; globalActions(); From 33f38736c48cd63685378c9dcb3ab58b122e6e1f Mon Sep 17 00:00:00 2001 From: Daniel Sogl Date: Tue, 30 May 2017 21:31:50 +0200 Subject: [PATCH 3/3] Update app.component.ts --- src/app/app.component.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/app/app.component.ts b/src/app/app.component.ts index 3fbf46f..540f977 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -15,16 +15,19 @@ import { User } from '../providers/user'; export class MyApp { rootPage: any = null; - constructor(private platform: Platform, private statusBar: StatusBar, private splashScreen: SplashScreen, private user: User, private config: Config) { + constructor(public platform: Platform, public statusBar: StatusBar, public splashScreen: SplashScreen, public user: User, public config: Config) { + + } + + ionViewDidLoad() { + let globalActions = function() { // Okay, so the platform is ready and our plugins are available. // Here you can do any higher level native things you might need. statusBar.styleDefault(); splashScreen.hide(); }; - } - ionViewDidLoad() { this.platform.ready().then(() => { this.user.isAuthenticated().then(() => { console.log('you are authenticated!');