Angularjs Bootstrap Example - Jquery

How to use bootstrap styles in angularjs?

Snippet Code

Rate this page :
  [ 0 votes]

Angular bootstrap is a popular style chart in jquery. The code allows you to style your chart for your required needs. The sample code to given below is used to explain you how to use bootstrap with angularjs.

<script src=''></script> <link rel="stylesheet" href = ""> <script src= ""></script> <script src=''></script> <script> customDirectives = angular.module('customDirectives', []); customDirectives.directive('customTabs', function () { return { restrict: 'A', template: '\ <ul class="nav nav-tabs">\ <li class="active"><a href="#{{contentBaseId}}-1" data-toggle="tab">Tab 1</a></li>\ <li><a href="#{{contentBaseId}}-2" data-toggle="tab">Tab 2</a></li>\ <li><a href="#{{contentBaseId}}-3" data-toggle="tab">Tab 3</a></li>\ </ul>\ <div class="tab-content">\ <div class="tab-pane active" id="{{contentBaseId}}-1">This is tab1 test content.</div>\ <div class="tab-pane" id="{{contentBaseId}}-2">This is tab2 test content.</div>\ <div class="tab-pane" id="{{contentBaseId}}-3">This is tab3 test content.</div>\ </div>', link: function(scope, el, attrs){ scope.contentBaseId = attrs.tabsBaseId; } }; }); angular.module('CustomComponents', ['customDirectives']); </script> <div ng-app="customDirectives" style='width:220px;'> <div custom-tabs tabs-base-id="content-tab"></div> </div> <style> .nav-tabs { font-size: 1em !important; font-weight: bold !important; } </style>


Ask Questions

Ask Question