Problems injecting $ionicHistory

I’ve got an app where I need to manipulate $ionicHistory so that hitting back goes back 2 panes.

my controller definition looks like this:

.controller("FeedController", ['$scope', '$stateParams', '$ionicLoading', '$http', '$ionicHistory', '$state',
						function($scope, $stateParams, $ionicLoading, $http, $ionicHistory, $state) {

but when i’m in my controller, $ionicHistory is undefined. what could be causing this?

oh and this is inside of a side menu, i know that there are issues with side menu and $ionicHistory but from what i’ve read those only apply to menu-close vs menu-toggle causing your history to get jumbled.

try this with a click function:

  $scope.myGoBack = function() {

actually it turned out that i was working with the wrong controller. i was in the controller for the page inside of my side menu when i should have been putting this code in the side menu’s controller since that’s where back gets called.

thanks for your help though. just trying that back example made me realize i was thinking about my controllers the wrong way.