3

I am using angular js ui.bootstrap in my project and I want to add tabs using ui bootstrap. I am using ui.bootstrap directive for tabs. But there is no ul li content inside that angular ui bootstrap tag.

<uib-tabset active="active">
     <uib-tab index="0" heading="Static title 1">Static content 1</uib-tab>
     <uib-tab index="0" heading="Static title 2">Static content 2</uib-tab>
     <uib-tab index="0" heading="Static title 3">Static content 3</uib-tab>
</uib-tabset>

I want to add a span tag inside the a tag in tabs. This is the output I want.

<li ng-class="{active: active, disabled: disabled}" index="0" heading="Static title 1" class="ng-isolate-scope active">
   <a href="" ng-click="select()" uib-tab-heading-transclude="" class="ng-binding">
    <span class="badge">5</span>Static title 1
   </a>
</li>

If anyone knows how to do this, please help me find out the solution.

Thanks in advance.

1 Answer 1

4

You could use uib-tab-heading directive inside uib-tab to have your own custom html inside heading. Thereafter you can specified your html content inside uib-tab-heading element then that would be transcluded inside tab header.

Markup

<uib-tabset active="active">
    <uib-tab index="0" heading="Static title 1">
        <uib-tab-heading>
            <span class="badge">5</span>Static title 1
        </uib-tab-heading>
    </uib-tab>
    <uib-tab index="0" heading="Static title 2">
        <uib-tab-heading><b>
        <span class="badge">5</span>Static title 3

    </uib-tab>
    </uib-tab>
    <uib-tab index="0" heading="Static title 3">
        <uib-tab-heading><b> memory utilization </b>
            <span class="badge">5</span>Static title 3
        </uib-tab-heading>
    </uib-tab>
</uib-tabset>
Sign up to request clarification or add additional context in comments.

1 Comment

Thanks Pankaj . :)

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.