Pen Settings



CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ add another resource


Babel is required to process package imports. If you need a different preprocessor remove all packages first.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource


Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.


                <html ng-app="myApp">
    <script src="//"></script>
    <script src="//"></script>
    <script src="//"></script>
    <h2>Form Select Emulation with Bootstrap 3 Button Groups &amp; AngularJS</h2><br />
    <form ng-controller="btnSelectDemo">
      <div class="form-group">
        <label class="control-label col-md-9" for="btnSelect">{{label}}: </label>
        <div class="btn-toolbar">
          <div class="btn-group col-md-9">
            <button type="button" class="btn btn-default btn-lg col-md-6" data-toggle="dropdown" id="btnSelect">{{choosen.title}}</button>
            <button type="button" class="btn btn-info btn-lg dropdown-toggle" data-toggle="dropdown"><span class="caret"></span></button>
            <!-- Select dropdown -->
            <ul class="dropdown-menu col-md-12" role="menu">
              <li ng-repeat="book in items" ng-click="select($index)" ng-class="{true: 'selected'}[book.title == choosen.title]">
                <div class="row">
                <div class="col-md-12">
                  <span class="text-success" ng-show="book.title == choosen.title"><small><span class="glyphicon glyphicon-chevron-right"></span> Currently Selected<br /></small></span>
                    <strong class="text-info">{{book.title}}</strong>
                    <p class="text-muted">
                      Author(s): {{}}<br />
                      Publish Date: {{book.released}}
          </div> <!-- /.btn-toolbar -->
        </div> <!-- /.form-group -->
        <section class="row">
          <div class="col-md-12">
            <h3>Choosen Book</h3>
            <p class="text-muted">
              Author(s): {{}}<br />
              Published: {{choosen.released}}
            <a ng-href="{{}}" class="btn btn-info" target="_blank">Purchase @ Packt <span class="glyphicon glyphicon-play"></span></a>
</html> <!-- /ng-app -->


                body {
  padding: 20px;

.control-label {
  font-size: 18px;

button#btnSelect {
  text-align: left;

.dropdown-menu {
  margin-left: 15px;

.dropdown-menu li {
  cursor: pointer;
  padding: 5px;

.dropdown-menu li.selected {
  background-color: #ddefdd;

.dropdown-menu li:hover {
  background-color: #e9e9e9;

section {
  margin: 25px 0 0 15px !important;


  $scope.label = 'Select A Book';
  $scope.items = [
      title: 'Mastering Web Application Development with AngularJS', 
      author: 'Peter Bacon Darwin, Pawel Kozlowski',
      released: 'August 2013',
      link: ''
      title: 'AngularJS Directives',
      author: 'Alex Vanston',
      released: 'September 2013',
      link: ''
      title: 'Instant AngularJS Starter',
      author: 'Dan Menard',
      released: 'February 2013',
      link: ''
  $scope.choosen = $scope.items[0];
  $ = function(i){
      $scope.choosen = $scope.items[i];
  }; // end select
}]); // end btnSelectDemo / module(myApp)