【发布时间】:2016-08-12 05:28:01
【问题描述】:
我有我的业务需求,我想更改 uib 选项卡的颜色。我有动态标签,所以每当我添加新标签时,我希望标签有自己的颜色。我有代码可以在添加选项卡时生成随机颜色,但不知道如何更改选项卡的颜色。
我的代码是:
<uib-tabset active="active">
<uib-tab index="$index + 1" ng-repeat="tab in tabs" disable="tab.disabled">
<uib-tab-heading>
<b>{{tab.title}}</b>
</uib-tab-heading>
<table class="table table-striped">
<thead>
<tr>
<th>Test A</th>
</tr>
</thead>
<tbody >
<tr ng-repeat="content in contents ">
<td>testing value</td>
<td>
</tr>
</tbody>
</table>
</uib-tab>
</uib-tabset>
添加标签
$scope.addTab = function (title, view) {
view = view || title + " Content View";
$scope.tabs.push({ title: title, content: view, disabled: false});
};
如果无法使用 uib 选项卡,请使用 angular js 的任何其他解决方案。
注意:我不想使用 tabset
【问题讨论】:
标签: javascript jquery angularjs tabs