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. 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

JavaScript

Babel is required to process package imports. If you need a different preprocessor remove all packages first.

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

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="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 >
    
    <ion-nav-view></ion-nav-view>
    
    <script id="app.html" type="text/ng-template">
<ion-side-menus>

  <ion-pane ion-side-menu-content>
    <ion-nav-bar class="bar-stable nav-title-slide-ios7">
      <ion-nav-back-button class="button-clear"><i class="icon ion-chevron-left"></i> Back</ion-nav-back-button>
    </ion-nav-bar>
    <ion-nav-view name="appContent" animation="slide-left-right"></ion-nav-view>
  </ion-pane>

  <ion-side-menu side="left">
      <ion-nav-view name="menuList"></ion-nav-view>
  </ion-side-menu>
</ion-side-menus>
      
    </script>    

    <script id="browse.html" type="text/ng-template">
<ion-view title="Browse">
  <ion-nav-buttons side="left">
    <button menu-toggle="left"class="button button-icon icon ion-navicon"></button>
  </ion-nav-buttons>
  <ion-content class="has-header">
    <h1>Browse</h1>
  </ion-content>
</ion-view>
      
    </script>    

    <script id="menuBrowse.html" type="text/ng-template">
<header class="bar bar-header bar-stable">
    <h1 class="title">Browse Menu</h1>
</header>
<ion-content class="has-header">
    <ion-list>
        <ion-item nav-clear menu-close href="#/app/search">
            Search
        </ion-item>
        <ion-item nav-clear menu-close href="#/app/playlists">
            Playlists
        </ion-item>
    </ion-list>
</ion-content>
      
    </script>    

    
    <script id="menuPlaylists.html" type="text/ng-template">
      <header class="bar bar-header bar-stable">
    <h1 class="title">Playlist Menu</h1>
</header>
<ion-content class="has-header">
    <ion-list>
        <ion-item nav-clear menu-close href="#/app/search">
            Search
        </ion-item>
        <ion-item nav-clear menu-close href="#/app/browse">
            Browse
        </ion-item>
    </ion-list>
</ion-content>

    </script>    

    
    <script id="menuSearch.html" type="text/ng-template">
<header class="bar bar-header bar-stable">
    <h1 class="title">Search Menu</h1>
</header>
<ion-content class="has-header">
    <ion-list>
        <ion-item nav-clear menu-close href="#/app/browse">
            Browse
        </ion-item>
        <ion-item nav-clear menu-close href="#/app/playlists">
            Playlists
        </ion-item>
    </ion-list>
</ion-content>
      
    </script>    

    <script id="playlist.html" type="text/ng-template">
<ion-view title="Playlist">
  <ion-content class="has-header">
    <h1>Playlist</h1>
  </ion-content>
</ion-view>
      
    </script>    

    <script id="playlists.html" type="text/ng-template">
<ion-view title="Playlists">
  <ion-nav-buttons side="left">
    <button menu-toggle="left" class="button button-icon icon ion-navicon"></button>
  </ion-nav-buttons>
  <ion-content class="has-header">
    <ion-list>
      <ion-item ng-repeat="playlist in playlists" href="#/app/playlists/{{playlist.id}}">
        {{playlist.title}}
      </ion-item>
    </ion-list>
  </ion-content>
</ion-view>
      
    </script>    

    <script id="search.html" type="text/ng-template">
<ion-view title="Search">
  <ion-nav-buttons side="left">
    <button menu-toggle="left" class="button button-icon icon ion-navicon"></button>
  </ion-nav-buttons>
  <ion-content class="has-header">
    <h1>Search</h1>
  </ion-content>
</ion-view>
      
    </script>    

    <script id="" type="text/ng-template">
      
    </script>    

    <script id="" type="text/ng-template">
      
    </script>    
    
    
    
  </body>
</html>

              
            
!

CSS

              
                
              
            
!

JS

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


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

            .state('app', {
                url: "/app",
                abstract: true,
                templateUrl: "app.html",
                controller: 'AppCtrl'
            })

            .state('app.search', {
                url: "/search",
                views: {
                    'appContent' :{
                        templateUrl: "search.html"
                    },
                    'menuList': {
                        templateUrl : "menuSearch.html"
                    }
                }
            })

            .state('app.browse', {
                url: "/browse",
                views: {
                    'appContent' :{
                        templateUrl: "browse.html"
                    },
                    'menuList': {
                        templateUrl : "menuBrowse.html"
                    }
                }
            })

            .state('app.playlists', {
                url: "/playlists",
                views: {
                    'appContent' :{
                        templateUrl: "playlists.html",
                        controller: 'PlaylistsCtrl'
                    },
                    'menuList': {
                        templateUrl : "menuPlaylists.html",
                        controller: "PlaylistsCtrl"
                    }

                }
            })

            .state('app.single', {
                url: "/playlists/:playlistId",
                views: {
                    'appContent' :{
                        templateUrl: "playlist.html",
                        controller: 'PlaylistCtrl'
                    }
                }
            })

        // if none of the above states are matched, use this as the fallback
        $urlRouterProvider.otherwise('/app/playlists');
    })

    .controller('AppCtrl', function($scope) {
    })

    .controller('PlaylistsCtrl', function($scope, $state) {
        $scope.playlists = [
            { title: 'Reggae', id: 1 },
            { title: 'Chill', id: 2 },
            { title: 'Dubstep', id: 3 },
            { title: 'Indie', id: 4 },
            { title: 'Rap', id: 5 },
            { title: 'Cowbell', id: 6 }
        ];

        $scope.goTabs = function() {
            console.log('Going to tabs!');
            $state.go("app.tabs.home");
        }
    })

    .controller('PlaylistCtrl', function($scope, $stateParams) {
    })

              
            
!
999px

Console