Angular UI Selection Tab not working properly

I am using Angular UI tabs as below. My problem here is the internal event uib-tabset select( heading="sorry"). Could you tell me how to solve this problem?

Here is the Plunker.

 <uib-tabset active="active">
    <uib-tab index="0" heading="Static title">Static content</uib-tab>
    <uib-tab index="3" select="alertMe()">
      <uib-tab-heading>
        <i class="glyphicon glyphicon-bell"></i> Alert!
      </uib-tab-heading>
      I've got an HTML heading, and a select callback. Pretty cool!
    </uib-tab>

     <uib-tab heading="My issue">
        <uib-tabset type="pills">
            <uib-tab heading="sorry" select="alertMe()">

            </uib-tab>

        </uib-tabset>
     </uib-tab>

</uib-tabset>
+4
source share
1 answer

You need to set the active attribute of the inner, nested uib-tabset to null. By default, the first tab is always selected, so the alertMe function is executed.

<uib-tabset active="active">
  <uib-tab index="0" heading="Static title">Static content</uib-tab>
  <uib-tab index="3" select="alertMe()">
    <uib-tab-heading>
      <i class="glyphicon glyphicon-bell"></i> Alert!
    </uib-tab-heading>
    I've got an HTML heading, and a select callback. Pretty cool!
  </uib-tab>

  <uib-tab heading="My issue">
    <uib-tabset type="pills" active="null">
      <uib-tab heading="sorry" select="alertMe()">

      </uib-tab>

    </uib-tabset>
  </uib-tab>

</uib-tabset>

Working plunker

Feedback OP:active="-1" Worked for me .

+2

Source: https://habr.com/ru/post/1649445/


All Articles