0

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>

2 Answers 2

2

Use ng-hide to your functionality like

<div class="border" ng-hide="activeForm==2">
    Hide me when Tab #3 is active.
</div>

Working plunker

Sign up to request clarification or add additional context in comments.

Comments

0

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>

Comments

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.