I am working with a tabset that has two options and I am binding data from a JSON file using Angular. What I would like to do is log the name of the tab that I click on to the console. I thought about using a "model" for this, but I am not sure if that is the right approach.
Here is my tabset:
<tabset>
<tab heading="tab1">
<div class="panel-body">
content
</div>
</tab>
<tab heading="tab2">
<div class="panel-body">
content
</div>
</tab>
</tabset>
I have come across something like this before:
<div class="radio radio-text" ng-init="topTable.value='topCategory'">
<label class="radio-inline"><input type="radio" ng-model="topTable.value" value="topCategory" ng-change="updateTotals(topTable.value)">TY Top 30 Categories</label>
<label class="radio-inline"><input type="radio" ng-model="topTable.value" value="topSupplier" ng-change="updateTotals(topTable.value)">TY Top 10 Suppliers</label>
<label class="radio-inline"><input type="radio" ng-model="topTable.value" value="topBrand" ng-change="updateTotals(topTable.value)">TY Top 10 Brands</label>
</div>
I would like to achieve something similar, where I can perform an action when a tab is clicked, just like with the radio buttons.