ui.bootstrap.tabs 如何知道 angularjs 控制器中哪个选项卡处于活动状态

ui.bootstrap.tabs how to know which tab is active in angularjs controller

我在 html 上设置的选项卡中有两个选项卡:

<tabset justified="true" style="padding:13px">
    <tab heading="Static profit" >
        content one                         
    </tab>
    <tab heading="Dinamic profit" >
        content two                         
    </tab>
</tabset>

我的问题是如何在控制器中知道哪个选项卡处于活动状态。我希望 show/hide 在 div 之外,具体取决于活动选项卡。

像这样尝试

<tabset justified="true" style="padding:13px">
    <tab heading="Static profit" ng-click="onTabSelect('tab1')" >
        content one                         
    </tab>
    <tab heading="Dinamic profit" ng-click="onTabSelect('tab2')">
        content two                         
    </tab>
</tabset>

js

$scope.onTabSelect=function(tabName){
  console.log(tabName);
}