How to get the index of the active tab?

Hi, I have tabs inside a modal with this code:

<ion-tabs class="tabs-positive tabs-top">

<ion-tab title="FIND">
<div class="list list-inset">
  <label class="item item-input">
    <i class="icon ion-search placeholder-icon"></i>
    <input type="text" ng-model="data.sight" placeholder="Find events or people" ng-change="searchSight()">
   ... More tabs

And I have a footer button that I want to perform a particular action according to the active tab, How do I get the active tab in Ionic?

Thank you very much!

You can use $ionicTabsDelegate.selectedIndex() to get the index of the current active tab, further info here:$ionicTabsDelegate/

1 Like