Pen Settings

HTML

CSS

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

JavaScript

Babel includes JSX processing.

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

Packages

Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.

Behavior

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

              
                <div ng-app="boomstrap">
  <div ng-controller="SelectDemoCtrl">
    <div class="row">
    <div class="form-group">
      <div class="col-sm-6">
        <ui-select ng-model="superhero.selected">
          <ui-select-match placeholder="Select or search a superhero ...">{{$select.selected}}</ui-select-match>
          <ui-select-choices repeat="hero in getSuperheroes($select.search) | filter: $select.search">
            <div ng-bind="hero"></div>
          </ui-select-choices>
        </ui-select>
      </div>
      <label class="col-sm-3 control-label">You have chosen {{ superhero.selected }}!</label>
    </div>
    </div>
  </div>
</div>
              
            
!

CSS

              
                body {
  padding: 36px 24px;
}

.row + .row {
  margin-top: 30px;
}

              
            
!

JS

              
                (function(Boomstrap) {
  'use strict';
  Boomstrap.controller('SelectDemoCtrl', ['$scope', function($scope) {

    $scope.superhero = {
      selected: 'Batman'
    };
       
    $scope.$watch('superhero.selected', function(newVal, oldVal) {
/*      if (newVal !== oldVal) {
        if ($scope.superheroes.indexOf(newVal) === -1) {
          $scope.superheroes.unshift(newVal);
        }
      }*/
    });
    
    $scope.getSuperheroes = function(search) {
     var newSupes = $scope.superheroes.slice();
      if (search && newSupes.indexOf(search) === -1) {
        newSupes.unshift(search);
      }
      return newSupes;
    }
    
    $scope.superheroes = [
      'Superman',
      'Batman',
      'Spider-Man',
      'Thor',
      'Hal Jordan',
      'Wonder Woman',
      'Hulk',
      'Captain America',
      'Martian Manhunter',
      'Dick Grayson',
      'Thing',
      'Human Torch',
      'Fantastic',
      'Invisible Woman',
      'Wally West',
      'Aquaman',
      'Green Arrow',
      'Kyle Rayner',
      'Superboy',
      'Leonardo',
      'Raphael',
      'Donatello',
      'Michelangelo',
      'Silver Surfer',
      'Iron Man',
      'Barry Allen',
      'Tim Drake',
      'Black Canary',
      'Billy Batson',
      'Orion',
      'Hercules',
      'Daredevil',
      'Supergirl',
      'Black Panther',
      'Wolverine',
      'Cyborg',
      'Steel',
      'Donna Troy',
      'Vixen',
      'Raven',
      'Plastic Man',
      'Red Tornado',
      'Barbara Gordon',
      'Beast Boy',
      'Hawkgirl',
      'John Stewart',
      'Starfire',
      'Zatanna',
      'Ray Palmer',
      'Damian Wayne',
      'Huntress (Bertinelli)',
      'Hank Pym',
      'Hawkeye',
      'Professor X',
      'Jericho',
      'Rorschach',
      'Manhattan',
      'Nite Owl (Dreiberg)',
      'Nick Fury',
      'Hawkman',
      'Bart Allen',
      'Bucky Barnes',
      'Alan Scott',
      'Jay Garrick',
      'Cassandra Cain',
      'Phantom Stranger',
      'Blue Beetle',
      'Black Lightning',
      'Miracle',
      'Big Barda',
      'Booster Gold',
      'Kilowog',
      'Wasp',
      'Silk Spectre',
      'Miss Martian',
      'Knight',
      'Firestorm',
      'Nova',
      'Beast',
      'Skaar',
      'Lightray',
      'She-Hulk',
      'Captain Atom',
      'Power Girl',
      'Vision',
      'Damage',
      'Terrific',
      'Beta Ray Bill',
      'Squire',
      'Mon-El',
      'Black Widow',
      'Simon Baz',
      'Geo-Force',
      'Adam Strange',
      'Iron Fist',
      'Kaine',
      'Wildcat',
      'Jesse Chambers',
      'Wonder Man',
      'Carol Danve'
    ].sort();
  }]);
})(angular.module('boomstrap'));
              
            
!
999px

Console