On my Ionic App I have 3 tabs, after going back to a page which has some processes I need to go to one of the tabs and show it as the selected one.
This works
$state.go("app.tabs").then(function () {
$ionicTabsDelegate.$getByHandle('myTabs').select(0);
});
But problem is that $state.go reloads the whole controller so I used $state.transitionTo as shown in some StackOverflow threads
$state.transitionTo('app.tabs', {}, {
reload: false,
inherit: true,
notify: false
}).then(function() {
$ionicTabsDelegate.$getByHandle('myTabs').select(1);
});
but it is giving me the below error.
ionic.bundle.js:150 Delegate for handle “myTabs” could not find a corresponding element with delegate-handle=“myTabs”! select() was not called! Possible cause: If you are calling select() immediately, and your element with delegate-handle=“myTabs” is a child of your controller, then your element may not be compiled yet. Put a $timeout around your call to select() and try again.
So I tried wrapping it in a timeout
$timeout(
$ionicTabsDelegate.$getByHandle('myTabs').select(1);
, 10)
But nothing happens. How do I fix this?