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 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


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.


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 lang="en" >
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <!-- Angular Material style sheet -->
  <link rel="stylesheet" href="">
<body ng-app="MyApp">
  <!-- Your HTML content here -->
  <!--------  Today's theme --------->
  <div layout="row" class="theme" layout-align="center center">Day 22: Search</div>

  <!--------  Working area --------->
  <div class="working-area">
  <div ng-controller="DemoCtrl as ctrl" layout="column" class="autocompletedemoBasicUsage">
  <md-content class="md-padding">
    <form ng-submit="$event.preventDefault()">
      <p id="autocompleteDescription">
        Just start<code>typing</code> a US state...
      <label id="favoriteStateLabel">Favorite State</label>
      <md-autocomplete ng-disabled="ctrl.isDisabled" md-no-cache="ctrl.noCache" md-selected-item="ctrl.selectedItem" md-search-text-change="ctrl.searchTextChange(ctrl.searchText)" md-search-text="ctrl.searchText" md-selected-item-change="ctrl.selectedItemChange(item)" md-items="item in ctrl.querySearch(ctrl.searchText)" md-item-text="item.display" md-min-length="0" placeholder="Ex. Alaska" input-aria-labelledby="favoriteStateLabel" input-aria-describedby="autocompleteDetailedDescription">
          <span md-highlight-text="ctrl.searchText" md-highlight-flags="^i">{{item.display}}</span>
          No states matching "{{ctrl.searchText}}" were found.
          <a ng-click="ctrl.newState(ctrl.searchText)">Create a new one!</a>

  <!--------  Footer --------->
  <div layout="row" layout-align="center center" class="background-color-green"><h3>Youtube tutorial <a href="" target="_blank"> here!</a></h3></div><br>
  <div layout="row" layout-align="center center" class="background-color-green">Created by Eleftheria</div>
  <div id="footer" layout="row" layout-align="center center" class="background-color-green">
      <!-- Linkedin -->
      <a href="" target="_blank"><img src="" class="footer_image" alt="linkedin" title="linkedin"></a> ~
      <!-- Codepen -->
      <a href="" target="_blank"><img src="" class="footer_image" alt="codepen" title="codepen"></a> ~
      <!-- Youtube -->
      <a href="" target="_blank"><img src="" class="footer_image" alt="youtube" title="youtube"></a> ~
      <!-- Twitter -->
      <a href="" target="_blank"><img src="" class="footer_image" alt="twitter" title="twitter"></a> ~
      <!-- Github -->
      <a href="" target="_blank"><img src="" class="footer_image" alt="github" title="github"></a> ~ 
      <!-- Instagram -->
      <a href="" target="_blank"><img src="" class="footer_image" alt="instagram" title="instagram"></a> ~
    <!-- Website -->
      <a href="" target="_blank"><img src="" class="footer_image" alt="website" title="website"></a>
  <!-- Angular Material requires Angular.js Libraries -->
  <script src=""></script>
  <script src=""></script>
  <script src=""></script>
  <script src=""></script>

  <!-- Angular Material Library -->
  <script src=""></script>
  <!-- Your application bootstrap  -->
  <script type="text/javascript">    
     * You must include the dependency on 'ngMaterial' 
    angular.module('MyApp', ['ngMaterial', 'ngMessages']);


Copyright 2016-2019 Google Inc. All Rights Reserved. 
Use of this source code is governed by an MIT-style license that can be found in the LICENSE file at


                body {
  background-image: linear-gradient(to top, #a8edea 0%, #fed6e3 100%);

.theme {
  padding:32px 0 32px 0;

.working-area {
  width: 90%;
  height: 50%;
  margin: 0 auto;
  background-color: rgba(142,36,170,0.3);
  padding: 16px;
  border-radius: 8px;

#footer .footer_image {
  height: 24px;
  text-align: center;
  padding: 4px;


                (function () {
  'use strict';
      .module('MyApp', ['ngMaterial', 'ngMessages', 'material.svgAssetsCache'])
      .controller('DemoCtrl', DemoCtrl);

  function DemoCtrl ($timeout, $q, $log) {
    var self = this;

    self.simulateQuery = false;
    self.isDisabled    = false;

    // list of `state` value/display objects
    self.states        = loadAll();
    self.querySearch   = querySearch;
    self.selectedItemChange = selectedItemChange;
    self.searchTextChange   = searchTextChange;

    self.newState = newState;

    function newState(state) {
      alert("Sorry! You'll need to create a Constitution for " + state + " first!");

     * Search for states... use $timeout to simulate
     * remote dataservice call.
    function querySearch (query) {
      var results = query ? self.states.filter(createFilterFor(query)) : self.states,
      if (self.simulateQuery) {
        deferred = $q.defer();
        $timeout(function () { deferred.resolve(results); }, Math.random() * 1000, false);
        return deferred.promise;
      } else {
        return results;

    function searchTextChange(text) {
      $'Text changed to ' + text);

    function selectedItemChange(item) {
      $'Item changed to ' + JSON.stringify(item));

     * Build `states` list of key/value pairs
    function loadAll() {
      var allStates = 'Alabama, Alaska, Arizona, Arkansas, California, Colorado, Connecticut, Delaware,\
              Florida, Georgia, Hawaii, Idaho, Illinois, Indiana, Iowa, Kansas, Kentucky, Louisiana,\
              Maine, Maryland, Massachusetts, Michigan, Minnesota, Mississippi, Missouri, Montana,\
              Nebraska, Nevada, New Hampshire, New Jersey, New Mexico, New York, North Carolina,\
              North Dakota, Ohio, Oklahoma, Oregon, Pennsylvania, Rhode Island, South Carolina,\
              South Dakota, Tennessee, Texas, Utah, Vermont, Virginia, Washington, West Virginia,\
              Wisconsin, Wyoming';

      return allStates.split(/, +/g).map(function (state) {
        return {
          value: state.toLowerCase(),
          display: state

     * Create filter function for a query string
    function createFilterFor(query) {
      var lowercaseQuery = query.toLowerCase();

      return function filterFn(state) {
        return (state.value.indexOf(lowercaseQuery) === 0);