I want to remove previous state from history so that clicking back will take user two states back. Here is what I did.
app.controller('postBlogCtrl', function($scope, $state, $http, $ionicLoading,
$rootScope, $filter, genericServices, $ionicHistory){
if($rootScope.previousStateName != "app.community-feed"){
$ionicHistory.removeBackView();
}
};
I am getting an error TypeError: $ionicHistory.removeBackView is not a function.
It seems like your version of ionic is too old . Use "ionic info" into the CLI to check your version . I know for sure that this removeBackView() is not present in ionic 1.2.4 but present in 1.2.7
.Alternatively you can check www/lib/ionic/js/ionicbundle.js . If this file contains the removeBackView() method then something else seems to be the problem . If not , just upgrade the ionic version . You can visit http://code.ionicframework.com/ to check the ionicbundle.js of different versions .Choose a version whose ionicbundle.js file has this function
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With