Issue
I created login and logout functionality I given logout in side menu. Logout functionality working properly but the problem after logout side menu is seeing. How to hide side menu after logout and go home page.
Solution
You can use the menuClose
directive:
The
menuClose
directive can be placed on any button to close an open menu.
A simple menuClose button can be added using the following markup:
<button ion-button menuClose>Close Menu</button>
or
<button ion-item menuClose>Close Menu</button>
That would make the menu to be closed when you select the logout option from the side menu.
If you want to have more control over the menu, you can use the MenuController
and use it to close the menu programmatically, from the component code.
import { Component } from '@angular/core';
import { MenuController } from 'ionic-angular';
@Component({...})
export class MyPage {
constructor(public menuCtrl: MenuController) {
}
openMenu() {
this.menuCtrl.open();
}
closeMenu() {
this.menuCtrl.close();
}
toggleMenu() {
this.menuCtrl.toggle();
}
}
Answered By - sebaferreras
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.