in my application i am having two types of user, for that there are different menu options.
After login i am setting root page to two different pages, for the first time it shows correct options but after logging out second type of user get login but displaying the previous menu.
for 1 user type my code is:-
After login
this.navCtrl.setRoot(ChomePage);
Menu list in ChomePage
chome.html
<ion-menu [content]="ccontent">
<ion-content class="l-menu">
<ion-list>
<ion-item text-center>
<img class="menu-logo" src="assets/imgs/contractor_profile.png"/>
<h3>Welcome <strong>ABC</strong></h3>
</ion-item>
<button menuClose ion-item icon-start *ngFor="let p of menulist" (click)="openPage(p)">
<ion-icon [name]="p.icon"></ion-icon>
{{p.title}}
</button>
</ion-list>
</ion-content>
</ion-menu>
<!-- Disable swipe-to-go-back because it's poor UX to combine STGB with side menus -->
<ion-nav [root]="rootPage" #ccontent swipeBackEnabled="false"></ion-nav>
chome.ts
rootPage:any= ChistoryPage;
this.menulist = [
{ title: 'History',component:ChistoryPage,icon:''},
]
for 2 user type
this.navCtrl.setRoot(OhomePage);
MenuList in OhomePage
this.menulist = [
{ title: 'Jobs',component:ChistoryPage,icon:''},
]
but it loads with the menu list for the user type logged in first time. After ctr+F5 it loads correctly.