Pen Settings

HTML

CSS

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

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

Auto Save

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="ionicApp">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no, width=device-width"> 
    
    <title>Ionic Modal</title>

    <link href="https://code.ionicframework.com/1.0.0-beta.4/css/ionic.css" rel="stylesheet">
    <script src="https://code.ionicframework.com/1.0.0-beta.4/js/ionic.bundle.js"></script>
  </head>
  <body ng-controller="AppCtrl">
    
    <ion-header-bar class="bar-positive">
      <h1 class="title">Contacts</h1>
      <div class="buttons">
        <button class="button button-icon ion-compose" ng-click="openModal()">
        </button>
      </div>
    </ion-header-bar>
    <ion-content>
      <p>Open the Modal By Tapping Top Right Icon</p>
    </ion-content>
    
    <script id="modal.html" type="text/ng-template">
      <div class="modal" ng-controller="ModalCtrl">
        <ion-header-bar class="bar bar-header bar-positive">
          <h1 class="title">New Contact</h1>
          <button class="button button-clear button-primary" ng-click="modal.hide()">Cancel</button>
        </ion-header-bar>
        <ion-content>
          <div class="list" ng-if="showList">
          <div collection-repeat='friend in friends'
               collection-item-width="'100%'"
               collection-item-height="80"
               class="item my-item">
            <img src="http://fakeimg.pl/100/">
              <h2>{{friend.name}}</h2>
          </div>
        </ion-content>
      </div>
    </script>
    
  </body>
</html>

              
            
!

CSS

              
                body {
  cursor: url('https://ionicframework.com/img/finger.png'), auto;
}

.my-item {
  left: 0;
  right: 0;
}
              
            
!

JS

              
                angular.module('ionicApp', ['ionic'])

.controller('AppCtrl', function($scope, $ionicModal, $timeout) {

  $scope.contacts = [
    { name: 'Gordon Freeman' },
    { name: 'Barney Calhoun' },
    { name: 'Lamarr the Headcrab' },
  ];

    $scope.data = {
      showList : false
    };
    
    $scope.openModal = function() {
      $scope.modal.show();
      $timeout(function() {
      $scope.showList = true;
    }, 500)
    }

    $ionicModal.fromTemplateUrl('modal.html', {
    scope: $scope,
    animation: 'slide-in-up'
    }).then(function(modal) {
    $scope.modal = modal;
    }); 

    $scope.friends= [{
    id: 1,
    name: 'Ann Ward',
    description: 'He who has health has hope.',
    img: 'img/friend1.jpg'
    }, {
    id: 2,
    name: 'Blair Waldorf',
    description: 'I am a happy Student',
    img: 'img/friend2.jpg'
    }, {
    id: 3,
    name: 'Brittani Klane',
    description: 'Two heads are better than one.',
    img: 'img/friend3.jpg'
    }, {
    id: 4,
    name: 'Bruce Wayne',
    description: 'It takes all sorts to make a world.',
    img: 'img/friend4.jpg'
    }, {
    id: 5,
    name: 'Carlie Kloss',
    description: 'Every man has his taste. ',
    img: 'img/friend5.jpg'
    }, {
    id: 6,
    name: 'Cara Delevingne',
    description: 'Experience is the extract of suffering.',
    img: 'img/friend6.jpg'
    }, {
    id: 7,
    name: 'CoCo Rocha',
    description: 'phone gap is good to learn',
    img: 'img/friend7.jpg'
    }, {
    id: 8,
    name: 'Doreen Alridge',
    description: 'fast and fouries',
    img: 'img/friend8.jpg'
    }, {
    id: 9,
    name: 'David Ward',
    description: 'Love makes the world go round. ',
    img: 'img/friend1.jpg'
    }, {
    id: 10,
    name: 'Elin Dome',
    description: 'Time is money.',
    img: 'img/friend2.jpg'
    }, {
    id: 11,
    name: 'Frank Kswne',
    description: 'Trust men and they will be true to you.',
    img: 'img/friend3.jpg'
    }, {
    id: 12,
    name: 'Hanna Snnow',
    description: 'Haste makes waste.',
    img: 'img/friend4.jpg'
    }, {
    id: 13,
    name: 'Islan Picca',
    description: 'listen to my heart',
    img: 'img/friend5.jpg'
    }, {
    id: 14,
    name: 'Igips Dell',
    description: 'To entertain an angel unawares.',
    img: 'img/friend6.jpg'
    }, {
    id: 15,
    name: 'Mother Rona',
    description: 'phone gap is good to learn',
    img: 'img/friend7.jpg'
    }, {
    id: 16,
    name: 'Ocst Aloop',
    description: 'Seeing is believing. ',
    img: 'img/friend8.jpg'
    }];


})

.controller('ModalCtrl', function($scope) {

  $scope.newUser = {}; 

  $scope.createContact = function() {
    console.log('Create Contact', $scope.newUser);
    $scope.modal.hide();
  };

});
              
            
!
999px

Console