Hey there,
I have an app with multiple pages that have tabs. Every tab has lists with links on them.
When I open a detailed view from one of those lists I want to return to the same tab where I clicked the link in.
So I’m storing the tab that was opened in local storage with this function in my controller:
$scope.storeTab = function(tab_number){
$ionicTabsDelegate.select(tab_number);
StorageHandler.handle('localdata.open_tab',tab_number);
console.log('just stored tab '+StorageHandler.handle('localdata.open_tab') );
}
This is triggered in the partial view by using <ion-tab title="Room" ng-click="storeTab(1)">
etc.
This is working great. The only thing I’m having problems with is actually opening the correct tab upon going back.
When I use:
var open_tab = StorageHandler.handle('localdata.open_tab');
$ionicTabsDelegate.select(open_tab);
in my controller, the tabs won’t switch. I’ve tried adding a delegate handle to the tabs, and using a timeout on the select function. But nothing. Am I using this correctly? I’m using the nightly btw.
Anybody know what I’m doing wrong?