Procedure to remove back button text and add a simple back button at ionic app - android

Removing a back button text in ionic app is quite easy. You should use the $ionicConfigProvider to change the ionic back button title. Following code removes the back button title from the app

var myIonicApp = angular.module('myApp', ['ionic']);
myIonicApp.config(function ($ionicConfigProvider) {
    $ionicConfigProvider.backButton.previousTitleText(false).text('');
})

Add the below code to enable backbutton in your controller,

used -> $ionicView.beforeEnter the view is going to enter and is active.

$scope.$on('$ionicView.beforeEnter', function (event, viewData) {
      viewData.enableBack = true; /* Enable Back Button */
});

 

 

"ion-nav-back-button" enables back button. Following code places the back button at the title header since i have placed the snippet inside ionic navigation bar. Contents inside the "ion-nav-back-button" tag acts for back button action. Following code to be place at the template,

<ion-nav-bar> <ion-nav-back-button class="button-clear"> <i class="ion-arrow-left-c"></i> </ion-nav-back-button> </ion-nav-bar>
Category: