简体   繁体   English

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

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

I have two tabs in my tab set on html: 我在html上设置的标签中有两个标签:

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

My question is how to know in controller which tab is active. 我的问题是如何知道控制器中哪个选项卡处于活动状态。 I want show/hide outside div depending of active tab. 我想显示/隐藏div取决于活动选项卡。

Try like this 这样尝试

<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 js

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 在AngularUI引导程序中动态设置选项卡(ui.bootstrap.tabs) - Dynamically set tab in AngularUI Bootstrap (ui.bootstrap.tabs) 如何在angularjs中使用UI引导程序选项卡的内容动态地激活选项卡? - how to Dynamically Active tab with content for ui bootstrap tabs in angularjs? Angular UI Bootstrap分页在ui.bootstrap.tabs内部不起作用 - Angular UI bootstrap pagination not working inside ui.bootstrap.tabs Angular JS UI Bootstrap选项卡(ui.bootstrap.tabs)使页面在select上滚动/跳转 - Angular JS UI Bootstrap tabs (ui.bootstrap.tabs) causes page to scroll/jump on select 默认情况下未加载angularjs引导ui活动选项卡 - angularjs bootstrap ui active tabs not loaded by default angular ui bootstrap选项卡组件:未单击选项卡处于活动状态时如何获取选项卡内容 - angular ui bootstrap tabs component: how to get the content of a tab when the tab is active not clicked 使用Angular UI Bootstrap在动态创建的选项卡上设置活动选项卡 - Setting active tab on dynamically created tabs with Angular UI Bootstrap 如何在angularjs bootstrap选项卡上设置活动 - how to set active on angularjs bootstrap tab Angularjs-ui bootstrap.tabs-添加下一个选项卡按钮 - Angularjs-ui bootstrap.tabs - Adding Next tab button 如何将活动类应用于Bootstrap Tab UI - How to apply active class to bootstrap Tab ui
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM