Angular js - 仅使用 UI Bootstrap 的选项卡库
Angular js - Using UI Bootstrap's Tab library only
我只使用UI Bootstrap的Tab组件。
https://github.com/angular-ui/bootstrap/tree/master/src/tabs
在包含上述库并添加以下代码后,浏览器中没有任何结果。控制台中也没有错误。
var app = angular.module('app', ['ui.bootstrap.tabs']);
<tabset justified="true">
<tab heading="Justified">Justified content</tab>
<tab heading="SJ">Short Labeled Justified content</tab>
<tab heading="Long Justified">Long Labeled Justified content</tab>
</tabset>
我已经设法使用具有相同上述代码的完整 UI-Bootstrap 库来完成这项工作。我不想包含整个库,因为我只使用 Tab 模块。
http://plnkr.co/edit/DCNry4vEcL2VrcP9lv9J?p=preview
您需要包含模板。 @Fieldset的想法是正确的,只是可能不是解决问题的最明确的建议。
普伦克
如果仅包含选项卡.js,请确保单独添加模板。 您可以使用$templateCache脚本标记方法轻松执行此操作:
<script type="text/ng-template" id="template/tabs/tabset.html">
<div>
<ul class="nav nav-{{type || 'tabs'}}" ng-class="{'nav-stacked': vertical, 'nav-justified': justified}" ng-transclude></ul>
<div class="tab-content">
<div class="tab-pane"
ng-repeat="tab in tabs"
ng-class="{active: tab.active}"
tab-content-transclude="tab">
</div>
</div>
</div>
</script>
<script type="text/ng-template" id="template/tabs/tab.html">
<li ng-class="{active: active, disabled: disabled}">
<a href ng-click="select()" tab-heading-transclude>{{heading}}</a>
</li>
</script>
相关文章:
- jquery点击bootstrap 3选项卡上的事件
- 自动更改 Twitter Bootstrap 选项卡
- 使用AngularJS在Bootstrap选项卡之间移动DOM元素
- Angular Bootstrap选项卡在单击选项卡后更改url
- 在Bootstrap选项卡中操作Nicescroll scrolbar
- MixitUp 不使用 Bootstrap 选项卡窗格
- 第二个jQueryValidate在Bootstrap选项卡中不起作用
- 在BootStrap选项卡中添加动态选项卡
- 通过jQuery隐藏Bootstrap选项卡上的空元素
- Masonry js扰乱了Bootstrap选项卡功能
- Bootstrap 3选项卡,活动选项卡仅在firefox中悬停时闪烁
- Bootstrap 3选项卡-来自另一个页面的链接
- 如何聚焦/显示'选项卡窗格'如果使用jquery的bootstrap选项卡上的选项卡字段为空
- Bootstrap选项卡Active/inactive和Angularjs
- 链接到bootstrap选项卡,无需修改"标签
- 如何在多个Bootstrap选项卡上运行.js文件
- Jquery回调在bootstrap选项卡中没有触发
- jQuery FullCalendar在Bootstrap选项卡中不呈现
- 在bootstrap选项卡内向表内的行添加可拖动事件
- 使用jQuery更改活动Bootstrap 3选项卡