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

+ add another resource


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


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.


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 ng-app="ionicApp">
    <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="" rel="stylesheet">
    <script src=""></script>

    <ion-nav-bar class="nav-title-slide-ios7 bar-positive">
      <ion-nav-back-button class="button-icon ion-arrow-left-c">
    <ion-nav-view animation="slide-left-right"></ion-nav-view>

    <script id="tabs.html" type="text/ng-template">
      <ion-tabs class="tabs-icon-top">

        <!-- Pets Tab -->
        <ion-tab title="Dashboard" icon="icon ion-home" href="#/tab/dash">
          <ion-nav-view name="tab-dash"></ion-nav-view>

        <!-- Adopt Tab -->
        <ion-tab title="Friends" icon="icon ion-heart" href="#/tab/friends">
          <ion-nav-view name="tab-friends"></ion-nav-view>

        <!-- About Tab -->
        <ion-tab title="Account" icon="icon ion-gear-b" href="#/tab/account" hidden="true">
          <ion-nav-view name="tab-account"></ion-nav-view>


    <script id="tab-friends.html" type="text/ng-template">
      <ion-view title="Friends">
        <ion-content class="has-header">
            <ion-item ng-repeat="friend in friends" type="item-text-wrap" href="#/tab/friend/{{}}">

    <script id="tab-dash.html" type="text/ng-template">
      <ion-view title="Dashboard">
        <ion-content class="has-header padding">
          <a class="button" href="#/tab/account">Go To Hidden Account Tab</a>

    <script id="tab-account.html" type="text/ng-template">
      <ion-view title="Account">
        <ion-content class="has-header padding">

    <script id="tab-frienddetail.html" type="text/ng-template">
      <ion-view title="{{}}">
        <ion-content has-header="true" padding="true">





                // Ionic Starter App

// angular.module is a global place for creating, registering and retrieving Angular modules
// 'starter' is the name of this angular module example (also set in a <body> attribute in index.html)
// the 2nd parameter is an array of 'requires'
// '' is found in services.js
// 'starter.controllers' is found in controllers.js
angular.module('ionicApp', ['ionic', 'starter.controllers', ''])

.run(function($ionicPlatform) {
  $ionicPlatform.ready(function() {
    if(window.StatusBar) {
      // org.apache.cordova.statusbar required

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

  // Ionic uses AngularUI Router which uses the concept of states
  // Learn more here:
  // Set up the various states which the app can be in.
  // Each state's controller can be found in controllers.js

    // setup an abstract state for the tabs directive
    .state('tab', {
      url: "/tab",
      abstract: true,
      templateUrl: "tabs.html"

    // Each tab has its own nav history stack:

    .state('tab.dash', {
      url: '/dash',
      views: {
        'tab-dash': {
          templateUrl: 'tab-dash.html',
          controller: 'DashCtrl'

    .state('tab.friends', {
      url: '/friends',
      views: {
        'tab-friends': {
          templateUrl: 'tab-friends.html',
          controller: 'FriendsCtrl'
    .state('tab.friend-detail', {
      url: '/friend/:friendId',
      views: {
        'tab-friends': {
          templateUrl: 'friend-detail.html',
          controller: 'FriendDetailCtrl'

    .state('tab.account', {
      url: '/account',
      views: {
        'tab-account': {
          templateUrl: 'tab-account.html',
          controller: 'AccountCtrl'

  // if none of the above states are matched, use this as the fallback


angular.module('starter.controllers', [])

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

.controller('FriendsCtrl', function($scope, Friends) {
  $scope.friends = Friends.all();

.controller('FriendDetailCtrl', function($scope, $stateParams, Friends) {
  $scope.friend = Friends.get($stateParams.friendId);

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

angular.module('', [])

 * A simple example service that returns some data.
.factory('Friends', function() {
  // Might use a resource here that returns a JSON array

  // Some fake testing data
  var friends = [
    { id: 0, name: 'Scruff McGruff' },
    { id: 1, name: 'G.I. Joe' },
    { id: 2, name: 'Miss Frizzle' },
    { id: 3, name: 'Ash Ketchum' }

  return {
    all: function() {
      return friends;
    get: function(friendId) {
      // Simple index lookup
      return friends[friendId];