The following code hides my hamburger menu when not in use and I'm trying to use the following lines of code across multiple components:
ionViewWillEnter(){
this.hamburgerMenu.enable(false)
}
ionViewWillLeave(){
this.hamburgerMenu.enable(true)
}
I believe that it would be beneficial for my app if I can just create reusable method that I can call using a service.
Is there a way for me to access and modify ionic life cycle using a service? If not, what would be my other option to create a reusable method to show/hide my hamburger menu?
I already tried importing the Component interface in my service and I was expecting that by doing so, I can be able to access the component's lifecycle. However, I was stuck and don't know what to do after importing the said interface.