css Audio - Active file-generic CSS - Active Generic - Active HTML - Active JS - Active SVG - Active Text - Active file-generic Video - Active header Love html icon-new-collection icon-person icon-team numbered-list123 pop-out spinner split-screen star tv

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

You're using npm packages, so we've auto-selected Babel for you here, which we require to process imports and make it all work. If you need to use a different JavaScript preprocessor, remove the packages in the npm tab.

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

Use npm Packages

We can make npm packages available for you to use in your JavaScript. We use webpack to prepare them and make them available to import. We'll also process your JavaScript with Babel.

⚠️ This feature can only be used by logged in users.

Code Indentation

     

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.

HTML Settings

Here you can Sed posuere consectetur est at lobortis. Donec ullamcorper nulla non metus auctor fringilla. Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.

            
              <html ng-app="ionicApp">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no, width=device-width">
    
    <title>Side Menus</title>

    <link href="//code.ionicframework.com/1.0.0-beta.12/css/ionic.css" rel="stylesheet">
    <script src="//code.ionicframework.com/1.0.0-beta.12/js/ionic.bundle.js"></script>
  </head>
 
  <body ng-controller="MainCtrl">
    
    <ion-nav-view></ion-nav-view>
    
    <script id="templates/event-menu.html" type="text/ng-template">
      <ion-side-menus>
        
        <ion-side-menu-content drag-content="$root.canDrag">
          <ion-nav-bar class="bar-positive"animation="no-animation">
            <ion-nav-back-button class="button-icon ion-arrow-left-c">
            </ion-nav-back-button>
          </ion-nav-bar>
          <ion-nav-buttons side="left">
            <button class="button button-icon button-clear ion-navicon" ng-click="toggleLeft()">
            </button>
          </ion-nav-buttons>
          <ion-nav-view animation="no-animation" name="menuContent"></ion-nav-view>
        </ion-side-menu-content> 
        
        <ion-side-menu side="left">
          <ion-header-bar class="bar-assertive">
            <h1 class="title">Left Menu</h1>
          </ion-header-bar>
          <ion-content>
            <ul class="list">
              <!-- Note each link has the 'menu-close' attribute so the menu auto closes when clicking on one of these links -->
              <a href="#/event/check-in" class="item" menu-close>Check-in</a>
              <a href="#/event/attendees" class="item" menu-close>Attendees</a>
              
              
               <a href="#/event/Page1" class="item" menu-close>Page1</a>
              
              
              <a href="#/event/Page2" class="item" menu-close>Page2</a>
              
              
            </ul>
          </ion-content>
        </ion-side-menu>
        
      </ion-side-menus>
    </script>
     <script id="templates/Page1.html" type="text/ng-template">
      <ion-view title="Page1">
        <ion-content padding="true" >         
          <p>Page1 Content</p>
        </ion-content>
      </ion-view>
    </script>
     <script id="templates/Page2.html" type="text/ng-template">
      <ion-view title="Page2">
        <ion-content padding="true">         
          <p>Page2 Content</p>
        </ion-content>
      </ion-view>
    </script>
    
    <script id="templates/home.html" type="text/ng-template">
      <ion-view title="Welcome">
        <ion-content padding="true">
          <p>Swipe to the right to reveal the left menu.</p>
          <p>(On desktop click and drag from left to right)</p>
        </ion-content>
      </ion-view>
    </script>
    
    <script id="templates/check-in.html" type="text/ng-template">
      <ion-view title="Event Check-in">
        <ion-content>
          <form class="list" ng-show="showForm">
            <div class="item item-divider">
              Attendee Info
            </div>
            <label class="item item-input">
              <input type="text" placeholder="First Name" ng-model="attendee.firstname">
            </label>
            <label class="item item-input">
              <input type="text" placeholder="Last Name" ng-model="attendee.lastname">
            </label>
            <div class="item item-divider">
              Shirt Size
            </div>
            <ion-radio ng-repeat="shirtSize in shirtSizes"
                       ng-value="shirtSize.value"
                       ng-model="attendee.shirtSize">
              {{ shirtSize.text }}
            </ion-radio>
            <div class="item item-divider">
              Lunch
            </div>
            <ion-toggle ng-model="attendee.vegetarian">
              Vegetarian
            </ion-toggle>
            <div class="padding">
              <button class="button button-block" ng-click="submit()">Checkin</button>
            </div>
          </form>

          <div ng-hide="showForm">
            <pre ng-bind="attendee | json"></pre> 
            <a href="#/event/attendees">View attendees</a>
          </div>
        </ion-content>
      </ion-view>
    </script>
    
    <script id="templates/attendees.html" type="text/ng-template">
      <ion-view title="Event Attendees" left-buttons="leftButtons">
        <ion-content>
          <div class="list">
            <ion-toggle ng-repeat="attendee in attendees | orderBy:'firstname' | orderBy:'lastname'"
                        ng-model="attendee.arrived"
                        ng-change="arrivedChange(attendee)">
              {{ attendee.firstname }}
              {{ attendee.lastname }}
            </ion-toggle>
            <div class="item item-divider">
              Activity
            </div>
            <div class="item" ng-repeat="msg in activity">
              {{ msg }}
            </div>
          </div>
        </ion-content>
      </ion-view>
    </script>
    
  </body>
</html>
            
          
!
            
              body {
  cursor: url('https://ionicframework.com/img/finger.png'), auto;
}
            
          
!
            
              angular.module('ionicApp', ['ionic'])

.config(function($stateProvider, $urlRouterProvider) {

  $stateProvider
    .state('eventmenu', {
      url: "/event",
      abstract: true,
      templateUrl: "templates/event-menu.html"
    })
    .state('eventmenu.home', {
      url: "/home",
      views: {
        'menuContent' :{
          templateUrl: "templates/home.html"
        }
      }
    })
  .state('eventmenu.Page1', {
      url: "/Page1",
      views: {
        'menuContent' :{
          templateUrl: "templates/Page1.html",
          controller: "Page1Ctrl"
        }
      }
    })
  
   .state('eventmenu.Page2', {
      url: "/Page2",
      views: {
        'menuContent' :{
          templateUrl: "templates/Page2.html",
          controller: "Page2Ctrl"
        }
      }
    })
  
    .state('eventmenu.checkin', {
      url: "/check-in",
      views: {
        'menuContent' :{
          templateUrl: "templates/check-in.html",
          controller: "CheckinCtrl"
        }
      }
    })
    .state('eventmenu.attendees', {
      url: "/attendees",
      views: {
        'menuContent' :{
          templateUrl: "templates/attendees.html",
          controller: "AttendeesCtrl"
        }
      }
    })
  
  $urlRouterProvider.otherwise("/event/home");
})

.controller('MainCtrl', function($scope, $ionicSideMenuDelegate) {
  $scope.$root.canDrag = true;
  $scope.attendees = [
    { firstname: 'Nicolas', lastname: 'Cage' },
    { firstname: 'Jean-Claude', lastname: 'Van Damme' },
    { firstname: 'Keanu', lastname: 'Reeves' },
    { firstname: 'Steven', lastname: 'Seagal' }
  ];
  
  $scope.toggleLeft = function() {
    $ionicSideMenuDelegate.toggleLeft();
  };
})

.controller('Page1Ctrl', function($scope) {
  $scope.$root.canDrag = false; 
})
.controller('Page2Ctrl', function($scope) {
  $scope.$root.canDrag = false; 
})

.controller('CheckinCtrl', function($scope) {
    $scope.$root.canDrag = true;

  $scope.showForm = true;
  
  $scope.shirtSizes = [
    { text: 'Large', value: 'L' },
    { text: 'Medium', value: 'M' },
    { text: 'Small', value: 'S' }
  ];
  
  $scope.attendee = {};
  $scope.submit = function() {
    if(!$scope.attendee.firstname) {
      alert('Info required');
      return;
    }
    $scope.showForm = false;
    $scope.attendees.push($scope.attendee);
  };
  
})

.controller('AttendeesCtrl', function($scope) {
    $scope.$root.canDrag = false;

  $scope.activity = [];
  $scope.arrivedChange = function(attendee) {
    var msg = attendee.firstname + ' ' + attendee.lastname;
    msg += (!attendee.arrived ? ' has arrived, ' : ' just left, '); 
    msg += new Date().getMilliseconds();
    $scope.activity.push(msg);
    if($scope.activity.length > 3) {
      $scope.activity.splice(0, 1);
    }
  };
  
});
            
          
!
999px
🕑 One or more of the npm packages you are using needs to be built. You're the first person to ever need it! We're building it right now and your preview will start updating again when it's ready.
Loading ..................

Console