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

  <title>Ionic Template</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="MyCtrl">
    <ion-content>
      <ion-list>
        <ion-item class="my-item" collection-repeat="airline in data.airlines"
                  collection-item-height="54"
                  >{{airline.name}}
        </ion-item>
      </ion-list>

      <ion-infinite-scroll  
      on-infinite="fetchAirlines()" 
      distance="10%">
      </ion-infinite-scroll>


    </ion-content>

  </body>
</html>

              
            
!

CSS

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

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

JS

              
                var airlines = [{"fs":"LCI","iata":"LF","icao":"LCI","name":"Lao Central Airlines ","active":true},{"fs":"TGU","iata":"5U","icao":"TGU","name":"TAG","active":true},{"fs":"BT","iata":"BT","icao":"BTI","name":"Air Baltic","active":true},{"fs":"9J","iata":"9J","icao":"DAN","name":"Dana Airlines","active":true},{"fs":"2O","iata":"2O","icao":"RNE","name":"Island Air Service","active":true},{"fs":"NPT","icao":"NPT","name":"Atlantic Airlines","active":true},{"fs":"C8","iata":"C8","icao":"ICV","name":"Cargolux Italia","active":true},{"fs":"FK","iata":"FK","icao":"WTA","name":"Africa West","active":true},{"fs":"8K","iata":"8K","icao":"EVS","name":"EVAS Air Charters","active":true},{"fs":"W8","iata":"W8","icao":"CJT","name":"Cargojet","active":true},{"fs":"JBW","iata":"3J","icao":"JBW","name":"Jubba Airways (Kenya)","active":true},{"fs":"TNU","iata":"M8","icao":"TNU","name":"TransNusa","active":true},{"fs":"HCC","iata":"HC","icao":"HCC","name":"Holidays Czech Airlines","active":true},{"fs":"APJ","iata":"MM","icao":"APJ","name":"Peach Aviation","active":true},{"fs":"TUY","iata":"L4","icao":"TUY","name":"LTA","active":true},{"fs":"LAE","iata":"L7","icao":"LAE","name":"LANCO","active":true},{"fs":"L5*","iata":"L5","icao":"LTR","name":"Lufttransport","active":true},{"fs":"QA","iata":"QA","icao":"CIM","name":"Cimber","active":true},{"fs":"KBZ","iata":"K7","icao":"KBZ","name":"Air KBZ","active":true},{"fs":"L2","iata":"L2","icao":"LYC","name":"Lynden Air Cargo","active":true},{"fs":"MPK","iata":"I6","icao":"MPK","name":"Air Indus","active":true},{"fs":"CAO","icao":"CAO","name":"Air China Cargo ","active":true},{"fs":"BEK","iata":"Z9","icao":"BEK","name":"Bek Air","active":true},{"fs":"IAE","iata":"IO","icao":"IAE","name":"IrAero","active":true},{"fs":"GL*","iata":"GL","name":"Airglow Aviation Services","active":true},{"fs":"ATN","iata":"8C","icao":"ATN","name":"ATI","active":true},{"fs":"GU","iata":"GU","icao":"GUG","name":"Aviateca Guatemala","active":true},{"fs":"GHY","icao":"GHY","name":"German Sky Airlines ","active":true},{"fs":"SS","iata":"SS","icao":"CRL","name":"Corsair","active":true},{"fs":"XK","iata":"XK","icao":"CCM","name":"Air Corsica","active":true},{"fs":"W9*","iata":"W9","icao":"JAB","name":"Air Bagan","active":true},{"fs":"Z8*","iata":"Z8","icao":"AZN","name":"Amaszonas","active":true},{"fs":"D2","iata":"D2","icao":"SSF","name":"Severstal Aircompany","active":true},{"fs":"SNC","iata":"2Q","icao":"SNC","name":"Air Cargo Carriers","active":true},{"fs":"PST","iata":"7P","icao":"PST","name":"Air Panama","active":true},{"fs":"VV","iata":"VV","icao":"AEW","name":"Aerosvit Airlines","active":true},{"fs":"UJ","iata":"UJ","icao":"LMU","name":"AlMasria","active":true},{"fs":"9U","iata":"9U","icao":"MLD","name":"Air Moldova","active":true},{"fs":"NF","iata":"NF","icao":"AVN","name":"Air Vanuatu","phoneNumber":"678 238 48","active":true},{"fs":"NJS","iata":"NC","icao":"NJS","name":"Cobham Aviation","active":true},{"fs":"1B","iata":"1B","name":"British Airways Cargo","active":true},{"fs":"GEC","icao":"GEC","name":"Lufthansa Cargo ","active":true},{"fs":"CND","iata":"CD","icao":"CND","name":"Corendon Dutch Airlines","active":true},{"fs":"AI","iata":"AI","icao":"AIC","name":"Air India","active":true},{"fs":"TAH","icao":"TAH","name":"Air Moorea","active":true},{"fs":"AG","iata":"AG","icao":"ABR","name":"Air Contractors","active":true},{"fs":"AP","iata":"AP","icao":"ADH","name":"Air One","active":true},{"fs":"4G","iata":"4G","icao":"GZP","name":"Gazpromavia","active":true},{"fs":"RAC","icao":"RAC","name":"Ryukyu Air Commuter","active":true},{"fs":"NS","iata":"NS","icao":"HBH","name":"Hebei Airlines","active":true},{"fs":"J0","iata":"J0","icao":"JLX","name":"Jet Link Express","active":true},{"fs":"UMK","iata":"2N","icao":"UMK","name":"Yuzmashavia","active":true},{"fs":"EAK","iata":"6Z","icao":"EAK","name":"Euro-Asia Air","active":true},{"fs":"SE","iata":"SE","icao":"XLF","name":"XL Airways France","active":true},{"fs":"SHT","icao":"SHT","name":"British Airways Shuttle","active":true},{"fs":"NC","iata":"NC","icao":"NAC","name":"Northern Air Cargo","active":true},{"fs":"YB*","iata":"YB","icao":"BRJ","name":"Bora Jet","active":true},{"fs":"BGM","iata":"2B","icao":"BGM","name":"Ak Bars Aero","active":true},{"fs":"2L","iata":"2L","icao":"OAW","name":"Helvetic Airways","active":true},{"fs":"NE*","iata":"NE","icao":"NMA","name":"Nesma Airlines","active":true},{"fs":"PE*","iata":"PE","icao":"PEQ","name":"Pacific Air Express","active":true},{"fs":"AJI","iata":"7Z","icao":"AJI","name":"Ameristar Jet Charter","active":true},{"fs":"VJC","iata":"VJ","icao":"VJC","name":"VietJet Air","active":true},{"fs":"ACP","iata":"8V","icao":"ACP","name":"Astral Aviation","active":true},{"fs":"AB","iata":"AB","icao":"BER","name":"Air Berlin","active":true},{"fs":"ECO","iata":"8J","icao":"ECO","name":"EcoJet","active":true},{"fs":"ATV","icao":"ATV","name":"Avanti Air","active":true},{"fs":"SYA","iata":"FS","icao":"SYA","name":"Syphax Airlines","active":true},{"fs":"ETR","iata":"E4","icao":"ETR","name":"Estelar","active":true},{"fs":"XG","iata":"XG","icao":"SXD","name":"SunExpress Deutschland","active":true},{"fs":"MML","iata":"MR","icao":"MML","name":"Hunnu Air","active":true},{"fs":"CA","iata":"CA","icao":"CCA","name":"Air China","phoneNumber":"1-800-986-1985","active":true},{"fs":"3H","iata":"3H","icao":"AIE","name":"Air Inuit","active":true},{"fs":"WJ","iata":"WJ","icao":"LAL","name":"Air Labrador","active":true},{"fs":"AC","iata":"AC","icao":"ACA","name":"Air Canada","phoneNumber":"1-800-247-2262","active":true},{"fs":"MD","iata":"MD","icao":"MDG","name":"Air Madagascar","active":true},{"fs":"FJ","iata":"FJ","icao":"FJI","name":"Fiji Airways","phoneNumber":"1-800-227-4446","active":true},{"fs":"CW","iata":"CW","icao":"MRS","name":"Air Marshall Islands","phoneNumber":"1-692-625-3733","active":true},{"fs":"HAY","iata":"HK","icao":"HAY","name":"Hamburg Airways","active":true},{"fs":"TVP","iata":"3Z","icao":"TVP","name":"Travel Service Polska","active":true},{"fs":"VOE","iata":"V7","icao":"VOE","name":"Volotea","active":true},{"fs":"AMF","iata":"A8","icao":"AMF","name":"Ameriflight","active":true},{"fs":"U7","iata":"U7","icao":"UGB","name":"Air Uganda","active":true},{"fs":"VGO","iata":"E3","icao":"VGO","name":"NewGen Airways","active":true},{"fs":"TRQ","iata":"3T","icao":"TRQ","name":"Tarco Air","active":true},{"fs":"NZ","iata":"NZ","icao":"ANZ","name":"Air New Zealand","phoneNumber":"1-800-262-1234","active":true},{"fs":"PX","iata":"PX","icao":"ANG","name":"Air Niugini","active":true},{"fs":"YW","iata":"YW","icao":"ANE","name":"Air Nostrum","active":true},{"fs":"FL","iata":"FL","icao":"TRS","name":"AirTran","phoneNumber":"1-800-247-8726","active":true},{"fs":"XOJ","icao":"XOJ","name":"XOJET","active":true},{"fs":"WW*","iata":"WW","icao":"WOW","name":"WOW Air","active":true},{"fs":"BG","iata":"BG","icao":"BBC","name":"Biman Bangladesh Airlines","active":true},{"fs":"AS","iata":"AS","icao":"ASA","name":"Alaska Airlines","phoneNumber":"1-800-252-7522","active":true},{"fs":"EH","iata":"EH","icao":"AKX","name":"ANA Wings","active":true},{"fs":"BM","iata":"BM","icao":"BMR","name":"bmi Regional","active":true},{"fs":"B5","iata":"B5","name":"Fly SAX","active":true},{"fs":"JN*","iata":"JN","icao":"NLV","name":"New Livingston","active":true},{"fs":"S9","iata":"S9","icao":"IKM","name":"Starbow","active":true},{"fs":"BC","iata":"BC","icao":"SKY","name":"Skymark Airlines","active":true},{"fs":"OS","iata":"OS","icao":"AUA","name":"Austrian","active":true},{"fs":"LB*","iata":"LB","name":"Air Costa","active":true},{"fs":"CJ","iata":"CJ","icao":"CFE","name":"BA CityFlyer","active":true},{"fs":"BA","iata":"BA","icao":"BAW","name":"British Airways","phoneNumber":"1-800-AIRWAYS","active":true},{"fs":"0B","iata":"0B","icao":"BMS","name":"Blue Air","active":true},{"fs":"EVE","iata":"E9","icao":"EVE","name":"Evelop Airlines","active":true},{"fs":"C5","iata":"C5","icao":"UCA","name":"CommutAir","active":true},{"fs":"NT","iata":"NT","icao":"IBB","name":"Binter Canarias","active":true},{"fs":"KF","iata":"KF","icao":"BLF","name":"Blue1","active":true},{"fs":"D9","iata":"D9","icao":"DNV","name":"Donavia","active":true},{"fs":"JA","iata":"JA","icao":"BON","name":"B&H Airlines","active":true},{"fs":"CX","iata":"CX","icao":"CPA","name":"Cathay Pacific","active":true},{"fs":"SN","iata":"SN","icao":"BEL","name":"Brussels Airlines","active":true},{"fs":"I4*","iata":"I4","name":"Island Air Express","active":true},{"fs":"C6","iata":"C6","icao":"CJA","name":"CanJet Airlines","active":true},{"fs":"MU","iata":"MU","icao":"CES","name":"China Eastern Airlines","active":true},{"fs":"GK","iata":"GK","icao":"JJP","name":"Jetstar Japan","active":true},{"fs":"4C*","iata":"C4","icao":"CGK","name":"Click Airways","active":true},{"fs":"CL","iata":"CL","icao":"CLH","name":"Lufthansa CityLine","active":true},{"fs":"CN","iata":"CN","icao":"GDC","name":"Grand China Air","active":true},{"fs":"CZ","iata":"CZ","icao":"CSN","name":"China Southern Airlines","active":true},{"fs":"FIV","icao":"FIV","name":"CitationAir","active":true},{"fs":"AGY","iata":"EO","icao":"AGY","name":"Air Go Egypt","active":true},{"fs":"DE","iata":"DE","icao":"CFG","name":"Condor","active":true},{"fs":"A2","iata":"A2","icao":"CIU","name":"Cielos Del Peru","active":true},{"fs":"OK","iata":"OK","icao":"CSA","name":"CSA","active":true},{"fs":"GTA","iata":"E8","icao":"GTA","name":"City Airways","active":true},{"fs":"D7","iata":"D7","icao":"XAX","name":"AirAsia X","active":true},{"fs":"KEM","iata":"5Z","icao":"KEM","name":"CemAir","active":true},{"fs":"DTS","iata":"DH","icao":"DTS","name":"Douniah Airlines","active":true},{"fs":"EB","iata":"EB","icao":"PLM","name":"Pullmantur Air","active":true},{"fs":"U2","iata":"U2","icao":"EZY","name":"easyJet","active":true},{"fs":"EXT","icao":"EXT","name":"Nightexpress","active":true},{"fs":"KTK","icao":"KTK","name":"Katekavia","active":true},{"fs":"FTZ","iata":"FN","icao":"FTZ","name":"Fastjet","active":true},{"fs":"M4*","iata":"M4","icao":"SME","name":"Smart Aviation","active":true},{"fs":"NIN","iata":"6N","icao":"NIN","name":"Niger Airlines","active":true},{"fs":"7Z","iata":"7Z","icao":"HCV","name":"Halcyonair","active":true},{"fs":"HR","iata":"HR","icao":"HHN","name":"Hahn Air","active":true},{"fs":"OMT","iata":"CC","icao":"OMT","name":"CM Airlines","active":true},{"fs":"3R","iata":"3R","icao":"GAI","name":"Moskovia Airlines","active":true},{"fs":"GBQ","iata":"3G","icao":"GBQ","name":"Gambia Bird","active":true},{"fs":"M7","iata":"M7","icao":"MSL","name":"Marsland Aviation","active":true},{"fs":"JY","iata":"JY","icao":"IWY","name":"interCaribbean Airways","active":true},{"fs":"SPN","iata":"H8","icao":"SPN","name":"Sepahan Airlines","active":true},{"fs":"GV","iata":"GV","icao":"SMV","name":"Grant Aviation","active":true},{"fs":"PL*","iata":"PL","name":"Southern Air Charter","active":true},{"fs":"HTG","icao":"HTG","name":"Grossman Air Service","active":true},{"fs":"6P","iata":"6P","name":"Gryphon Airlines","active":true},{"fs":"H3","iata":"H3","name":"Harbour Air","active":true},{"fs":"HKI","icao":"HKI","name":"Hawkaire","active":true},{"fs":"HN*","iata":"HN","name":"Heavylift Cargo","active":true},{"fs":"YO","iata":"YO","icao":"MCM","name":"Heli Air Monaco","active":true},{"fs":"LIZ","iata":"Q9","icao":"LIZ","name":"Air Liaison","active":true},{"fs":"KH","iata":"KH","icao":"AAH","name":"Aloha Air Cargo","active":true},{"fs":"RJD","iata":"RG","icao":"RJD","name":"Rotana Jet","active":true},{"fs":"IB","iata":"IB","icao":"IBE","name":"Iberia","active":true},{"fs":"QX","iata":"QX","icao":"QXE","name":"Horizon Air","active":true},{"fs":"RQ","iata":"RQ","icao":"KMF","name":"Kam Air","active":true},{"fs":"IRQ","iata":"QB","icao":"IRQ","name":"Qeshm Air","active":true},{"fs":"CMV","iata":"3C","icao":"CMV","name":"Calima Aviacion","active":true},{"fs":"ID*","iata":"ID","icao":"BTK","name":"Batik Air","active":true},{"fs":"JC","iata":"JC","icao":"JEX","name":"JAL Express","active":true},{"fs":"P2","iata":"P2","icao":"XAK","name":"Airkenya","active":true}];

airlines.sort(function(a, b) {

	var airlineA = a.name.toLowerCase();
	var airlineB = b.name.toLowerCase();

	if(airlineA > airlineB) return 1;
	if(airlineA < airlineB) return -1;
	return 0;
});

angular.module('ionicApp', ['ionic'])
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
.factory('FlightDataService', function($q, $timeout) {

    var requestCounter = 0;
    var requestLimit = 20;

    var fetchAirlines = function() {
         
        console.log('Fetching more airlines! Request Count=' + requestCounter++);
      
        var start = requestCounter * requestLimit;
        
        return $timeout( function(){
          return airlines.slice( start , start + requestLimit  );

        }, 400);

    };

    return {

        fetchAirlines : fetchAirlines,

    }
})

.controller('MyCtrl', ['$scope', 'FlightDataService', function($scope, FlightDataService) {

    $scope.data = { "airlines" : [] };

    $scope.fetchAirlines = function() {
      console.log('Requested more airlines');

        FlightDataService.fetchAirlines().then(
            function(airlines) {
                $scope.data.airlines = $scope.data.airlines.concat(airlines);
              console.log('There are ' + $scope.data.airlines.length + ' airlines in list');
              
                $scope.$broadcast('scroll.infiniteScrollComplete');
            }
        )

    };

$scope.fetchAirlines()
                        
}]);
              
            
!
999px

Console