I got mine working, I think you can take what you need from the below example to get yours working - you will need to create something like the following: - the method is the same for “hidden” or “disabled” tab attributes - you can see in the HTML section below how the same controllers/functions can apply to both hidden and disabled attributes:
app.js: - add a controller to your tabs template call:
.state('tab', {
url: "/tab",
abstract: true,
templateUrl: "templates/tabs.html",
controller: 'TabsCtrl'
})
Then, in the “TabsCtrl” .controller:
.controller(‘TabsCtrl’, function($scope,$rootScope) {
$scope.tabControl = {
hideCars: true,
hideBikes: true,
hideShips: true
}
var refreshFinalizer = $rootScope.$on(‘updateTabsRefresh’, function (event, data) {
$scope.tabControl.hideCars = false;
$scope.tabControl.hideBikes= false ;
$scope.tabControl.hideShips= false ;
});
$scope.$on(‘$destroy’, function () {
refreshFinalizer ();
});
})
And then in your main tabs.html file (where you define all your tabs):
<ion-tabs tabbarPlacement="bottom" preloadTabs="false" #paymentTabs>
<ion-tab hidden="tabControl.hideCars" [root]="cars" [rootParams]="fooId" tabTitle="cars" tabIcon="pulse"></ion-tab>
<ion-tab disabled="tabControl.hideBikes" [root]="bikes" tabTitle="bikes" [rootParams]="fooId" tabIcon="analytics"></ion-tab>
<ion-tab hidden="tabControl.hideShips" [root]="ships" tabTitle="ships" [rootParams]="fooId" tabIcon="card" ></ion-tab>
</ion-tabs>
And finally, in your one active/shown Tab that has your form is in, in that Tabs controller, perform your tests or conditions that will determine whether to hide/show or disable/enable your tabs: “hidden” literally hides or shows the tab whereas “disabled” will show the tab icon, but its disabled (greyed out) and can’t be clicked on.
$rootScope.$broadcast('updateTabsRefresh');
Let me know how this works out for you…it mightnot be exactly what you need, but I think it will get you real close - I am pretty certain the above will hide/unhide tabs for you. I tested mine on simply disabling the tabs (visible but not able to click on them) and it works cleanly.