How to open the home page after the user login


#1

Hello please I work on Ionic 3 and I would like to know how to close my login window and open a new window after a user has logged into my application.Thanks


#2

hi @durvilchat

you could use NavController in login credential true

import { NavController } from 'ionic-angular';

class MyComponent {
  constructor(public navCtrl: NavController) {

  }
  doLogin (){
     // you can pass parameter optiona
    //     this.navCtrl.push('HomePage',{'optional parameter'})
     //if you want back in last page 
     this.navCtrl.push('HomePage')


   // if do not back page 
   this.navCtrl.setRoot('HomePage')
  }
}

to more info


#3

Thanks Thanks my friend


#4

this.navCtrl.setRoot(‘HomePage’)

would be preferred. As you do not want the back icon to appear in the header.


#5

if your issue will solve you can like and solution mark of question