Angular Strap标签合理

时间:2014-10-28 15:03:46

标签: angularjs angular-ui-bootstrap angular-strap

我需要在我的应用程序中创建4个选项卡,在比较Angular UI和Angular Strap后,我决定使用Angular Strap。我在Angular Strap中失去了希望,这是我的最后一次尝试,然后我把它扔出我的应用程序。 我真的不知道制作Tabs Justified这么简单的事情是如此困难还是我错过了一些非常基本的东西?

我应该在哪里以及如何包含一个类来使Tabs合理化?感谢

标记:

<div class="col-lg-8 col-md-8 col-sm-8 col-lg-offset-2" ng-controller="TabsAndTablesCtrl">
    <div ng-model="tabs.activeTab" tabs.navClass bs-tabs>
        <div ng-repeat="tab in tabs" title="{{ tab.title }}" ng-bind="tab.content" bs-pane></div>
    </div>
</div>

控制器:

var app = angular.module('tabsAndTablesModule', ['ngAnimate', 'ngSanitize', 'mgcrea.ngStrap']);

app.controller('TabsAndTablesCtrl', function($scope) {

        $scope.tabs = [
            {title:'Projects', content: 'Raw denim you probably haven\'t heard of them jean shorts Austin. Nesciunt tofu stumptown aliqua, retro synth master cleanse. Mustache cliche tempor, williamsburg carles vegan helvetica.'},
            {title:'Tasks', content: 'Food truck fixie locavore, accusamus mcsweeney\'s marfa nulla single-origin coffee squid. Exercitation +1 labore velit, blog sartorial PBR leggings next level wes anderson artisan four loko farm-to-table craft beer twee.'},
            {title:'Documents', content: 'Etsy mixtape wayfarers, ethical wes anderson tofu before they sold out mcsweeney\'s organic lomo retro fanny pack lo-fi farm-to-table readymade.'},
            {title:'Users', content: 'Etsy mixtape wayfarers, ethical wes anderson tofu before they sold out mcsweeney\'s organic lomo retro fanny pack lo-fi farm-to-table readymade.'}
        ];

        $scope.tabs.activeTab = 1;
});

1 个答案:

答案 0 :(得分:1)

这是你可以添加一个类

的方法
<div ng-model="tabs.activeTab" nav-class='nav-justified nav-pills'..

请参阅Demo

还有documented