Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

TypeError: $ionicHistory.removeBackView is not a function

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.

like image 977
Abhijit Borade Avatar asked Sep 28 '26 00:09

Abhijit Borade


1 Answers

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

like image 53
UchihaItachi-Inactive-Account Avatar answered Sep 30 '26 13:09

UchihaItachi-Inactive-Account