Close Single View to return back to Tabbed View


#1

Currently, i am creating an app with tabs.

In one of the tab view, when user click a button, single view page appear.
And in that single view page, there is no back button since i am nagivating away from tab view.

So, I have manually added the back button on single view page with the following code below:

<ion-nav-buttons side="left">
<button class="button button-clear" ng-click="goBack()"><i class="icon ion-arrow-left-c" ></i> Back</button>
</ion-nav-buttons>

And in my controller.js

mod.controller('SingleCtrl', function($scope, $ionicLoading) {
  $scope.goBack = function() {
    $ionicHistory.goBack();
  };
})

When i click back button, nothing works. Am i missing something?
Or is there another alternative which i can close the single view to go back to previous tab view page?

Please advise
Thanks!


#2

Could you provide a little bit more code about state definition and so.
A codepen would be nice.

But you should know each tab has its own history-branch with the initial view of each tab as roots.