0

I have two tabs in my tab set on 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.

1 Answer 1

2

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

$scope.onTabSelect=function(tabName){
  console.log(tabName);
}
Sign up to request clarification or add additional context in comments.

1 Comment

how can i activate a tab programmatically without using ng-repeat?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.