Tabs in tab bar not changing


#1

So I have page with tabs at the top and ion-slides for content. When I swipe to the next page the tab should change.

In my slides options I am using onSlideChangeEnd to run a $ionicTabsDelegate.select(swiper.activeIndex) to change the selected tab. I put in a console log of the $ionicTabsDelegate.selectedIndex() after the select and it returns a different index then the one selected in the tabs bar.

Here is the code in codepen. Any suggestions?

Thank you


#2

I’m trying to achieve the exact same functionality and I am running into the same problem. Were you able to get this working yet?


#3

Figured out that you need to put a timeout function around the .select() to make it work properly.

$timeout(function () { $ionicTabsDelegate.select(index); }, 1);