Quantcast
Channel: Ionic Forum - Latest posts
Viewing all articles
Browse latest Browse all 229111

Side menu bar disappear after logging in

$
0
0

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>
	&nbsp;&nbsp;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>&nbsp;&nbsp;
		{{ p.title }}
		</button>
		<button ion-item menuClose (click)="logOut()"> 
		<ion-icon ios="ios-close-circle" md="md-close-circle"></ion-icon>
		&nbsp;&nbsp;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();

Viewing all articles
Browse latest Browse all 229111

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>