Hey all
I’m currently facing an issue with the back button title.
What happens is that the back button comes with a title at the back which represents the title of the previous page. My guess is that this is default behaviour.
For example, the page before titles ‘Group Info’. Then on the page after that which contains the back button will show ‘Group Info’ after the back arrow on top left.
Is there a way to hide this title altogether?
katand
February 24, 2015, 10:00am
2
I think you have to set the $ionicConfigProvider.backButton.previousTitleText()
to false. Here’s the doc .
Hi katand!
Thanks for the reply.
I’ve tried including the snippet you mentioned
$ionicConfigProvider.backButton.previousTitleText(false);
in my controller but it says it is an unknown provider.
I’ve also tried using $ionicConfig instead but it doesn’t seem to be working.
Note: The back button is the default one from index.html where I do not create a html element with bar-header and ion-buttons
katand
February 24, 2015, 10:08am
4
Try to use it in the function .config
which is placed in app.js per default
Hi katand
I’ve edited my .config() in app.js to look something like this. And it still doesn’t work!
.config(['$httpProvider', '$ionicConfigProvider', function($httpProvider, $ionicConfigProvider) {
$httpProvider.defaults.useXDomain = true;
delete $httpProvider.defaults.headers.common['X-Requested-With'];
$ionicConfigProvider.backButton.previousTitleText(false);
}
])
Okay I’ve got it to work.
Needed
$ionicConfigProvider.backButton.text('');
to work