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>Issue with Side Menus</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">-->
  <body ng-app="ionicApp">

    <ion-side-menus enable-menu-with-back-views="false">
        <ion-side-menu-content>
            <ion-nav-bar class="bar-stable">
                <ion-nav-back-button></ion-nav-back-button>
                <ion-nav-buttons side="left">
                    <button class="button button-icon button-clear ion-navicon" menu-toggle="left"></button>
                </ion-nav-buttons>
            </ion-nav-bar>
            <ion-nav-view></ion-nav-view>
        </ion-side-menu-content>
        <ion-side-menu side="left">
            <ion-header-bar class="bar-stable">
                <div class="title">Menu</div>
            </ion-header-bar>
            <ion-content padding="false" class="side-menu-left has-header">
                <ion-list>
                    <ion-item menu-close="" ui-sref="tabsController.startingPage">Starting page</ion-item>
                    <ion-item menu-close="" ui-sref="account">My Account</ion-item>
                    <ion-item menu-close="" ui-sref="about">About</ion-item>
                </ion-list>
            </ion-content>
        </ion-side-menu>
    </ion-side-menus>

    <script id="templates/tabsController.html" type="text/ng-template">
      <ion-view title="Tabs Controller Title">
    <ion-tabs id="tabsController-tabs1" class="tabs-stable tabs-icon-top">
        <ion-tab id="tabsController-tab1" title="Today" icon="ion-calendar" href="#/page1/start">
            <ion-nav-view name="tab1"></ion-nav-view>
        </ion-tab>
        <ion-tab id="tabsController-tab2" title="Weekplan" icon="ion-calendar" href="#/page1/weekplan">
            <ion-nav-view name="tab2"></ion-nav-view>
        </ion-tab>
    </ion-tabs>
</ion-view>
    </script>
    
    <script id="templates/startingPage.html" type="text/ng-template">
      <ion-view title="App Starting Page">
    <ion-content class="has-header" padding="true">
        <p>Starting page here. Please switch on the console in codepen.</p>
        <button class="button button-positive" ng-click="showAbout()">1) Go to the About page with this button via a function</button>
        <br><br>
        <p>2) After coming back from the About page, use the side menu to go to the 'My Account' page.</p>
    </ion-content>
</ion-view>
    </script>

    <script id="templates/about.html" type="text/ng-template">
      <ion-view title="About">
    <ion-content class="has-header" padding="true">
        <p>This is the About page. Go back to the starting page using the side menu item 'Starting page'.</p>
    </ion-content>
</ion-view>
    </script>

    <script id="templates/account.html" type="text/ng-template">
      <ion-view title="My Account">
    <ion-content class="has-header" padding="true">
        <p>My Account. Go back to the starting page using the button below (or the side menu again, doesn't matter) and observe the error in the console, and also see that the title displayed above will still be 'My Account'.</p>
        <a class="button button-positive" ui-sref="tabsController.startingPage">Back to starting page</a>
    </ion-content>
</ion-view>
    </script>

    <script id="templates/weekplan.html" type="text/ng-template">
      <ion-view title="Week Plan">
    <ion-content class="has-header" padding="true"></ion-content>
</ion-view>
    </script>
    
  </body>
</html>
              
            
!

CSS

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

JS

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

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

  $stateProvider
    .state('tabsController.startingPage', {
    url: '/start',
    views: {
      'tab1': {
        templateUrl: 'templates/startingPage.html',
        controller: 'startingPageCtrl'
      }
    }
  })

  .state('tabsController.weekplan', {
    url: '/weekplan',
    views: {
      'tab2': {
        templateUrl: 'templates/weekplan.html',
        controller: 'weekplanCtrl'
      }
    }
  })

  .state('tabsController', {
    url: '/page1',
    templateUrl: 'templates/tabsController.html',
    abstract:true
  })

  .state('about', {
    url: '/about',
    templateUrl: 'templates/about.html',
    controller: 'aboutCtrl'
  })
  
  .state('account', {
    url: '/account',
    templateUrl: 'templates/account.html',
    controller: 'accountCtrl'
  })

$urlRouterProvider.otherwise('/page1/start');
})

.controller('startingPageCtrl', ['$scope', '$state', '$stateParams', 
function ($scope, $state, $stateParams) {
    $scope.showAbout = function () {
        // note: in the real project, I'm using an ID here to show a detail page:
        // $state.go('detailview', {id: idToShow});
        $state.go('about');
    };
}])

.controller('weekplanCtrl', ['$scope', '$stateParams', 
function ($scope, $stateParams) {
  // not important here
}])
   
.controller('friendsCtrl', ['$scope', '$stateParams', 
function ($scope, $stateParams) {
  // not important here
}])
      
.controller('aboutCtrl', ['$scope', '$stateParams', 
function ($scope, $stateParams) {
  // not important here
}])

.controller('accountCtrl', ['$scope', '$stateParams', 
function ($scope, $stateParams) {
  // not important here
}]);
              
            
!
999px

Console