Skip to content

Instantly share code, notes, and snippets.

@ajoslin
Created July 26, 2012 11:52
Show Gist options
  • Save ajoslin/3181630 to your computer and use it in GitHub Desktop.
Save ajoslin/3181630 to your computer and use it in GitHub Desktop.
bootstrap tabs in plain angular
<!-- Tab links at top, always visible with one 'active' -->
<ul class="nav nav-tabs">
<li ng-repeat="tab in tabs" ng-class="{active: selectedTab == tab}" ng-click="selectedTab = tab">
<a ng-href="#{{tab.id}}">{{tab.title}}</a>
</li>
</ul>
<!-- Tab contents, only one ever visible -->
<div class="tab-content">
<div ng-repeat="tab in tabs" class="tab-pane" ng-class="selectedTab == tab && 'active' || 'hide'" id="{{tab.id}}">
<!-- can have tabs' content be ng-included as a template, or just put html here -->
<div ng-include="tab.templateUrl"></div>
</div>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment