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. You can use the CSS from another Pen by using it's URL and the proper URL extention.

+ 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

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

    <title>Tabs Example</title>

    <link href="//code.ionicframework.com/nightly/css/ionic.css" rel="stylesheet">
    <script src="//code.ionicframework.com/nightly/js/ionic.bundle.js"></script>
  </head>

  <body ng-controller="MainCtrl as main">
    <ion-view>
      <ion-item>
        <label class="item item-input item-select">
          {{friend.selectedTicket.name}}
          <select ng-options="ticket as ticket.name for ticket in tickets track by ticket.name"
                  ng-model="friend.selectedTicket"
                  ng-disabled="!friend.isPresent"
                  ng-change="countAll()" style="width: 30px">

          </select> 
        </label>
      </ion-item>

      <!-- the check box -->
      <ion-item>
        <ion-checkbox
                 ng-model="friend.isPresent"
                 ng-change="countAll()"
                 />Is Friend Present</ion-checkbox>

      </ion-item>

      <ion-item class="item-text-wrap">
        <p>
          This is your <b>$scope.friend</b> object, notice how the selected ticket is an object. Also we need to specify what the <b>track by</b> field is so the control know how to determine what item to select
        </p>
        <p><br/>The data <b>$scope.friend</b></p>
        <pre>{{ friend | json }}</pre>
      </ion-item>


    </ion-view>
  </body>
</html>
              
            
!

CSS

              
                
              
            
!

JS

              
                angular.module('app', ['ionic'] )
  .controller('MainCtrl', ['$scope', function($scope) {

    $scope.friend = {
      isPresent : true,
      selectedTicket : {"name" :"ticket two"} // <-- this is the default item
    };

    $scope.tickets = [
      {name : "ticket one"},
      {name : "ticket two"},
      {name : "ticket three"},   
    ];

    $scope.countAll = function() {
     
    }
  }]);
              
            
!
999px

Console