Pen Settings



CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using its URL and the proper URL extension.

+ 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" ng-app="MuppetApp">
    <link rel="stylesheet" href="">
    <link rel="stylesheet" href=",400,500,700,400italic">
    <meta name="viewport" content="initial-scale=1" />
  <body layout="column" ng-controller="AppCtrl">
    <md-toolbar layout="row">
      <md-button ng-click="toggleSidenav('left')" hide-gt-sm class="md-icon-button menuBtn">
        <md-icon aria-label="Menu" md-svg-icon=""></md-icon>
      <h1 layout-align-gt-sm="center" class="md-toolbar-tools">My Favorite Muppets</h1>
    <div layout="row" flex class="content-wrapper">
        <md-sidenav layout="column" class="md-sidenav-left md-whiteframe-z2" md-component-id="left" md-is-locked-open="$mdMedia('gt-sm')">
          <md-list class="muppet-list">
            <md-item ng-repeat="it in muppets">
                <md-button ng-click="selectMuppet(it)" ng-class="{'selected' : it === selected }">
                  <img ng-src="{{it.iconurl}}" class="face" alt="">
        <div layout="column" flex class="content-wrapper" id="primary-col">
            <md-content layout="column" flex class="md-padding">
              <div class="cell">
                <img ng-src="{{selected.imgurl}}" alt="{{selected.imgalt}}">
    <!-- Angular Material Dependencies -->
    <script src=""></script>
    <script src=""></script>
    <script src=""></script>

    <script src=""></script>


  margin-top: 6px;
  margin-right: 0;

.muppet-list .md-button {
  color: inherit;
  text-align: left;
  width: 100%;
.muppet-list .selected {
  color: #03a9f4;
.face {
  border-radius: 30px;
  border: 1px solid #ddd;
  display: inline-block;
  margin: 4px 16px; 
  vertical-align: middle;
  width: 48px;
.content-wrapper {
  position: relative;
#primary-col {
  overflow: hidden;
#primary-col .md-button {
  margin: 8px auto 16px 0;
#primary-col .cell {
  flex: 1 1 auto;
#primary-col img {
  display: block;
  max-width: 100%;


                var app = angular.module('MuppetApp', ['ngMaterial']);

app.controller('AppCtrl', ['$scope', '$mdSidenav', 'muppetService', '$timeout','$log', function($scope, $mdSidenav, muppetService, $timeout, $log) {
  var allMuppets = [];
  $scope.selected = null;
  $scope.muppets = allMuppets;
  $scope.selectMuppet = selectMuppet;
  $scope.toggleSidenav = toggleSidenav;
  // Internal Methods
  function loadMuppets() {
        allMuppets = muppets;
        $scope.muppets = [].concat(muppets);
        $scope.selected = $scope.muppets[0];
  function toggleSidenav(name) {
  function selectMuppet(muppet) {
    $scope.selected = angular.isNumber(muppet) ? $scope.muppets[muppet] : muppet;

app.service('muppetService', ['$q', function($q) {
  var muppets = [{
      name: 'Animal',
      iconurl: '',
      imgurl: '',
      content: 'Animal is the wild and frenzied drummer of Dr. Teeth and The Electric Mayhem, the fictional band from The Muppet Show. He is one of the Muppets originally created by Michael K. Frith.'
  }, {
      name: 'Fozzie Bear',
      iconurl: '',
      imgurl: '',
      content: 'Fozzie Bear is a Muppet character created by Jim Henson and developed by Frank Oz. Fozzie is an orange-brown, fozzie bear who often wears a brown pork pie hat and a red-and-white polka-dot necktie. The character debuted on The Muppet Show, as the show\'s stand-up comic, a role where he constantly employed his catchphrase, "Wocka Wocka Wocka!". Shortly after telling the joke, he was usually the target of ridicule, particularly from balcony hecklers Statler and Waldorf.'
  }, {
      name: 'The Swedish Chef',
      iconurl: '',
      imgurl: '',
      content: 'The Swedish Chef is a Muppet character that appeared on The Muppet Show. He was originally performed by Jim Henson and Frank Oz simultaneously, with Henson performing the head and voice and Oz performing the character\'s live hands. The Swedish Chef is now performed by Bill Barretta.'
  }, {
      name: 'Cookie Monster',
      iconurl: '',
      imgurl: '',
      content: 'Cookie Monster is a Muppet on the long running children\'s television show Sesame Street. He is best known for his voracious appetite and his famous eating phrases: "Me want cookie!", "Me eat cookie!", and "Om nom nom nom" (said through a mouth full of food). He often eats anything and everything, including danishes, donuts, lettuce, apples, bananas, as well as normally inedible objects. However, as his name suggests, his preferred food is cookies. Chocolate chip cookies are his favorite kind; oatmeal cookies are his second favorite.'

  // Promise-based API
  return {
      loadAll: function() {
          // Simulate async nature of real remote calls
          return $q.when(muppets);