Hello, everyone.
Hope there is someone can help me to solve the question.
After logging in to the application, i have to click “ENTER” then the menu bar just appear on the first page (rootPage)
Anything is wrong in my coding?
This is my Menu bar coding (.html)
<ion-menu [content]="content">
<ion-header>
<ion-navbar>
<ion-title>Menu</ion-title>
</ion-navbar>
</ion-header>
<ion-content>
<ion-list>
<button ion-item menuClose (click)="goToSignup()">
<ion-icon ios="ios-person-add" md="md-person-add">
</ion-icon>
Create staff account</button>
<button ion-item menuClose *ngFor="let p of pages" (click)="openPage(p)">
<ion-icon item start [name]="p.icon" [color]="isActive(p)"></ion-icon>
{{ p.title }}
</button>
<button ion-item menuClose (click)="logOut()">
<ion-icon ios="ios-close-circle" md="md-close-circle"></ion-icon>
Log Out</button>
</ion-list>
</ion-content>
</ion-menu>
<ion-nav [root]="rootPage" #content swipeBackEnabled="false"></ion-nav>
Here is my coding for login verification(.ts)
this.authData.loginUser(this.loginForm.value.email, this.loginForm.value.password)
.then(authData => {
this.loading.dismiss().then(() =>{
if(this.loginForm.value.email == "ai150172@siswa.uthm.edu.my")
{
this.navCtrl.setRoot('DashboardPage');
}
else
{
this.navCtrl.setRoot('StaffDashPage');
}
});
}, error =>{
this.loading.dismiss().then(()=>{
let alert = this.alertCtrl.create({
message:error.message,
buttons:[
{
text:"OK",
role:'cancel'
}
]
});
alert.present();
});
});
this.loading = this.loadingCtrl.create();
this.loading.present();