Skip to content
This repository has been archived by the owner on May 29, 2019. It is now read-only.

Use ng-if to hide inactive tabs #3109

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/tabs/tabs.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ angular.module('ui.bootstrap.tabs', [])
link: function(scope, element, attrs) {
scope.vertical = angular.isDefined(attrs.vertical) ? scope.$parent.$eval(attrs.vertical) : false;
scope.justified = angular.isDefined(attrs.justified) ? scope.$parent.$eval(attrs.justified) : false;
scope.hideTabs = angular.isDefined(attrs.hideTabs) ? scope.$parent.$eval(attrs.hideTabs) : false;
}
};
})
Expand Down
3 changes: 2 additions & 1 deletion template/tabs/tabset.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
<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-repeat="tab in tabs"
ng-if="tab.active || !hideTabs"
ng-class="{active: tab.active}"
tab-content-transclude="tab">
</div>
Expand Down