Hi, I’m having trouble with switching pages with different sliding menu. For example, when I try to use setRoot to my menu page, the set rootPage view won’t load and retains the old root page. Does this commonly happens to you?
export class DefaultMenu {
rootPage: any = 'DefaultPage';
constructor() {,
}
gotoPage() {
this.navCtrl.setRoot('MenuPage');
}
}
export class MenuPage {
rootPage: any = 'HomePage';
}
The MenuPage
is called through this.navCtrl.setRoot('MenuPage')
from another or default page. The menu is loaded but its rootPage
which should be showing the HomePage
is not showing, instead retains the old/default rootPage which is the DefaultPage
.
Has anyone encountered this kind of problem especially for starters like me?
I’m using Lazy Loading by the way.
Update.
I got the variable navCtrl
mixed up with NavController
instead of Nav
. My bad. I don’t know why but it should be this.nav.setRoot()
. I’m confused with the two.