So what i want is to set a rootPage and not something that is directing me to that page but whenever i start the app it goes to the root page no forwarding. I can’t seem to find it anywhere so could someone maybe help me out?
In your app.component.ts
export class MyApp {
rootPage:any = “yourpage”;
}
change it to your page, and import it to your app.component.ts
Did not work for me
import {Component, ViewChild} from '@angular/core';
import {NavController, Platform} from '@ionic/angular';
import {SplashScreen} from '@ionic-native/splash-screen/ngx';
import {StatusBar} from '@ionic-native/status-bar/ngx';
import { Router } from '@angular/router';
@Component({
selector: 'app-root',
templateUrl: 'app.component.html'
})
export class AppComponent {
rootPage:any = '/getting-started';
constructor(
private platform: Platform,
private splashScreen: SplashScreen,
private statusBar: StatusBar) {
this.initializeApp();
}
// Eindigt constructor
initializeApp() {
this.platform.ready().then(() => {
this.splashScreen.hide();
// set status bar naar onze app kleur
this.statusBar.backgroundColorByHexString('#E84B56');
});
}
}
change it to your class name example
rootPage:any = 'GettingStartedPage';
1 Like