I want to show RegisterPage, based on the result of, if condition inside the constructor. I’m new to Ionic and Angular. Can anyone suggest me to do this requirement
app.component.ts
export class MyApp {
@ViewChild(Nav) navCtrl: Nav;
rootPage:any = RegisterPage;
constructor(platform: Platform) {
platform.ready().then(() => {
statusBar.styleDefault();
splashScreen.hide();
if(localStorage["User"]||localStorage["Tenant"]===null){
this.navCtrl.push(RegisterPage); //call reg form
}
else{
//call login form
}
});
}
}
app.html
<ion-nav #mainContent [root]="rootPage"></ion-nav>