[英]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.