From fe283c5d2c2f8d70e0ad269c283d9358703bd224 Mon Sep 17 00:00:00 2001 From: Daniel Sogl Date: Sat, 22 Apr 2017 18:30:22 +0200 Subject: [PATCH 1/4] Update app.component.ts In your side menu template, you are using a separate method to initialize the app. So in this template, it should be the same. --- src/app/app.component.ts | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/app/app.component.ts b/src/app/app.component.ts index ab78376..9ce4cca 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -4,18 +4,23 @@ import { StatusBar } from '@ionic-native/status-bar'; import { SplashScreen } from '@ionic-native/splash-screen'; import { HomePage } from '../pages/home/home'; + @Component({ templateUrl: 'app.html' }) export class MyApp { rootPage:any = HomePage; - constructor(platform: Platform, statusBar: StatusBar, splashScreen: SplashScreen) { - platform.ready().then(() => { + constructor(private platform: Platform, private statusBar: StatusBar, private splashScreen: SplashScreen) { + this.initializeApp(); + } + + initializeApp() { + this.platform.ready().then(() => { // 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(); + this.statusBar.styleDefault(); + this.splashScreen.hide(); }); } } From e4737c5bc3410b80230f55b6270b693a0e8a98f3 Mon Sep 17 00:00:00 2001 From: Daniel Sogl Date: Sat, 22 Apr 2017 18:43:08 +0200 Subject: [PATCH 2/4] Update app.component.ts --- src/app/app.component.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/app.component.ts b/src/app/app.component.ts index 9ce4cca..a1666a1 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -11,7 +11,7 @@ import { HomePage } from '../pages/home/home'; export class MyApp { rootPage:any = HomePage; - constructor(private platform: Platform, private statusBar: StatusBar, private splashScreen: SplashScreen) { + constructor(public platform: Platform, public statusBar: StatusBar, public splashScreen: SplashScreen) { this.initializeApp(); } From 49973ebe0aa0ea4fd2453167f8418338c7ed3913 Mon Sep 17 00:00:00 2001 From: Daniel Sogl Date: Sat, 22 Apr 2017 18:51:48 +0200 Subject: [PATCH 3/4] typo --- src/app/app.component.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/app.component.ts b/src/app/app.component.ts index a1666a1..092198b 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -9,7 +9,7 @@ import { HomePage } from '../pages/home/home'; templateUrl: 'app.html' }) export class MyApp { - rootPage:any = HomePage; + rootPage: any = HomePage; constructor(public platform: Platform, public statusBar: StatusBar, public splashScreen: SplashScreen) { this.initializeApp(); From 01544cadd0346746f51558521a790b0acb4eb49d Mon Sep 17 00:00:00 2001 From: Daniel Sogl Date: Tue, 30 May 2017 21:16:36 +0200 Subject: [PATCH 4/4] Update app.component.ts --- src/app/app.component.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/app/app.component.ts b/src/app/app.component.ts index 092198b..45f8453 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -12,10 +12,9 @@ export class MyApp { rootPage: any = HomePage; constructor(public platform: Platform, public statusBar: StatusBar, public splashScreen: SplashScreen) { - this.initializeApp(); } - initializeApp() { + ionViewDidLoad() { this.platform.ready().then(() => { // Okay, so the platform is ready and our plugins are available. // Here you can do any higher level native things you might need. @@ -24,4 +23,3 @@ export class MyApp { }); } } -