Reputation: 2397
Is there a way to detect if a specific tab is active and then hiding a div outside all tabs when it is active?
Plunker: https://plnkr.co/edit/b9O9S7JxxgzhQKcKONkn?p=preview
<div class="border">
Hide me when Tab #3 is active.
</div>
<hr>
<form name="outerForm" class="tab-form-demo">
<uib-tabset active="activeForm">
<uib-tab index="0" heading="Tab #1">
<ng-form name="nestedForm">
<div class="form-group">
<label>Name</label>
<input type="text" class="form-control" required ng-model="model.name"/>
</div>
</ng-form>
</uib-tab>
<uib-tab index="1" heading="Tab #2">
Some Tab Content
</uib-tab>
<uib-tab index="2" heading="Tab #3">
More Tab Content
</uib-tab>
</uib-tabset>
</form>
Upvotes: 0
Views: 1666
Reputation: 1570
Use ng-hide
to your functionality like
<div class="border" ng-hide="activeForm==2">
Hide me when Tab #3 is active.
</div>
Working plunker
Upvotes: 2
Reputation: 16
you can simply use the value of activeForm, which stores the value of the index(tab)
<div class="border" ng-show="activeForm != 2" >
Hide me when Tab #3 is active.
</div>
Upvotes: 0