简体   繁体   中英

Tabs with dropdowns angular ui

I am trying to create an application with Angularjs, angular ui and bootstrap 3. I need to create new tabs on the fly by adding object to the array.

<div ng-controller="PersonCtrl">
    <button ng-click="AddPerson()">Add Person</button>
    <button ng-click="RemovePerson()">Remove Person</button>
    <tabset>
    <tab ng-repeat="p in Persons" heading="{{[p.Name}}">
    </div>
    </tab>
    </tabset>
</div>

Instead of buttons to add and remove I want to add a Dropdown tab to the end. See the plunk... http://plnkr.co/edit/GtuG3UCS2WZvEZpoSiAj?p=preview

Look at this example in plunker. May be it will help you.

<div class="bs-example">
  <ul class="nav nav-pills">
    <li ng-repeat="p in Persons"><a href="#">{{p.Name}}</a></li>
    <li class="dropdown">
      <a href="#" data-toggle="dropdown" class="dropdown-toggle">Action <b class="caret"></b></a>
      <ul class="dropdown-menu">
        <li><a ng-click="AddPerson()" href="#">Add person</a></li>
        <li><a ng-click="RemovePerson()" href="#">Remove person</a></li>
      </ul>
    </li>
  </ul>
</div>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM