I’m having a familiar issue with the back button. I have a few intro pages to my app and at the homepage i want the menu icon to appear without the back button. Right now after the intro screens (which available to the user only at the first entrance to the app) the back button overrides the menu icon.
I’ve tried using the clear history method at every stage of the controller lifecycle, sometimes the button is removed but the menu icon isn’t appearing aswell so that leads to nowhere.
Also, the title is gone and popping up only after navigating to another page.
Is there any simple way to control which icon should appear?
Hello! To control wich icon should appear as the back button, you can use $ionicConfig, like so:
$ionicConfig.backButton.icon('ion-android-arrow-back'); // Inside 'app.run' function
But i don’t know if that’s really what you want to achieve… Do you want the icon to change depending on what state you are, or for it to change for the whole app?
I want the icon to change depending on state…
Well, i don’t know if it’s best practice (i think it is a bit hackish), but you could keep a variable of your current state, and throw a ‘if’ to check what state you are, and then change the icon via the code i commented before. But that wouldn’t be too practical… Sorry if i’m not much help, i’m a newbie to Ionic haha
A codepen would be helpful to understand your app structure, but you could set the next state as the root of the history before navigating to it.