[英]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. 我正在尝试使用Angularjs,angular ui和bootstrap 3创建一个应用程序。我需要通过将对象添加到数组来动态创建新选项卡。
<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
看到the ... 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>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.