title: Ionic shows a blank page without any error
body: <p>I am getting blank pages with Ionic. No errors show up in the chrome debugger. And when I inspect the debugger, I saw nothing inside of the ion-nav-view, which means for some reason the ui router is not working. Need help in figuring out the error. </p>
  
  <p>Here is my code:</p>
  
  <p>index.html:</p>
  
  <pre><code> &lt;!DOCTYPE html&gt;
  &lt;html&gt;
    &lt;head&gt;
      &lt;meta charset="utf-8"&gt;
      &lt;meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no, width=device-width"&gt;
      &lt;title&gt;&lt;/title&gt;
  
      &lt;link rel="manifest" href="manifest.json"&gt;
  
      &lt;!-- un-comment this code to enable service worker
      &lt;script&gt;
        if ('serviceWorker' in navigator) {
          navigator.serviceWorker.register('service-worker.js')
            .then(() =&gt; console.log('service worker installed'))
            .catch(err =&gt; console.log('Error', err));
        }
      &lt;/script&gt;--&gt;
  
      &lt;link href="lib/ionic/css/ionic.css" rel="stylesheet"&gt;
      &lt;link href="css/style.css" rel="stylesheet"&gt;
  
      &lt;!-- IF using Sass (run gulp sass first), then uncomment below and remove the CSS includes above
      &lt;link href="css/ionic.app.css" rel="stylesheet"&gt;
      --&gt;
  
      &lt;!-- ionic/angularjs js --&gt;
      &lt;script src="lib/ionic/js/ionic.bundle.js"&gt;&lt;/script&gt;
      &lt;script src="lib/ionic/js/angular/angular-resource.min.js"&gt;&lt;/script&gt;
      &lt;script src="lib/ionic/js/angular-ui/angular-ui-router.min.js"&gt;&lt;/script&gt;
      &lt;script src="lib/ngCordova/dist/ng-cordova.js"&gt;&lt;/script&gt;
  
      &lt;!-- cordova script (this will be a 404 during development) --&gt;
      &lt;script src="cordova.js"&gt;&lt;/script&gt;
  
      &lt;!-- your app's js --&gt;
      &lt;script src="js/app.js"&gt;&lt;/script&gt;
      &lt;script src="js/services.js"&gt;&lt;/script&gt;
      &lt;script src="js/controllers.js"&gt;&lt;/script&gt;
    &lt;/head&gt;
  
    &lt;body ng-app="watchHoursApp"&gt;
      &lt;ion-nav-view&gt;
      &lt;/ion-nav-view&gt;
    &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>menu.html:</p>
  
  <pre><code>&lt;ion-side-menus enable-menu-with-back-views="false"&gt;
    &lt;ion-side-menu-content&gt;
      &lt;ion-nav-bar class="bar-stable"&gt;
        &lt;ion-nav-back-button&gt;
        &lt;/ion-nav-back-button&gt;
  
        &lt;ion-nav-buttons side="left"&gt;
          &lt;button class="button button-icon button-clear ion-navicon" menu-toggle="left"&gt;
          &lt;/button&gt;
        &lt;/ion-nav-buttons&gt;
      &lt;/ion-nav-bar&gt;
      &lt;ion-nav-view name="menuContent"&gt;&lt;/ion-nav-view&gt;
    &lt;/ion-side-menu-content&gt;
  
    &lt;ion-side-menu side="left"&gt;
      &lt;ion-header-bar class="bar-stable"  &gt;
        &lt;h1 class="title"&gt;watchHours&lt;/h1&gt;
      &lt;/ion-header-bar&gt;
      &lt;ion-content&gt;
        &lt;ion-list&gt;
          &lt;ion-item menu-close ui-sref="app"&gt;
            HOME 
          &lt;/ion-item&gt;
          &lt;ion-item menu-close ng-if="currentUser" ui-sref="app.user({id: uid})"&gt;
            {{username}}
          &lt;/ion-item&gt;
          &lt;ion-item menu-close ui-sref="app.search"&gt;
            TV SHOWS
          &lt;/ion-item&gt;
          &lt;ion-item menu-close ng-if="!currentUser" ng-click="login()"&gt;
            Log in
          &lt;/ion-item&gt;
          &lt;ion-item menu-close ng-if="!currentUser" ng-click="register()"&gt;
            Sign up
          &lt;/ion-item&gt;
          &lt;ion-item menu-close ng-if="currentUser" ng-click="logout()"&gt;
            Log out
          &lt;/ion-item&gt;
        &lt;/ion-list&gt;
      &lt;/ion-content&gt;
    &lt;/ion-side-menu&gt;
  &lt;/ion-side-menus&gt;
  </code></pre>
  
  <p>app.js:</p>
  
  <pre><code>// 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 &lt;body&gt; attribute in index.html)
  // the 2nd parameter is an array of 'requires'
  // 'starter.controllers' is found in controllers.js
  angular.module('watchHoursApp', ['ionic'])
  
  .run(function($ionicPlatform) {
    $ionicPlatform.ready(function() {
      // Hide the accessory bar by default (remove this to show the accessory bar above the keyboard
      // for form inputs)
      if (window.cordova &amp;&amp; window.cordova.plugins.Keyboard) {
        cordova.plugins.Keyboard.hideKeyboardAccessoryBar(true);
        cordova.plugins.Keyboard.disableScroll(true);
  
      }
      if (window.StatusBar) {
        // org.apache.cordova.statusbar required
        StatusBar.styleDefault();
      }
    });
  })
  
  .config(function($stateProvider, $urlRouterProvider) {
    $stateProvider
      .state('app', {
        url: '/app',
        abstract: true,
        templateUrl: 'templates/menu.html',
        controller: 'SidemenuCtrl'
    });
    // if none of the above states are matched, use this as the fallback
    $urlRouterProvider.otherwise('/app');
  });
  </code></pre>
  
  <p>controller.js:</p>
  
  <pre><code>angular.module('watchHoursApp')
  
  .controller('SidemenuCtrl', ['$scope', '$state', '$rootScope', 'Shows', '$http', 
    '$location', '$localStorage', 'HomeServices', 'AuthFactory',
    '$ionicModal', '$ionicSideMenuDelegate', '$timeout',
    function ($scope, $state, $rootScope, Shows, $http, 
      $location, $localStorage, HomeServices,
      AuthFactory, $ionicModal, $ionicSideMenuDelegate, $timeout) {
      console.log("Hello");
    // With the new view caching in Ionic, Controllers are only called
    // when they are recreated or on app start, instead of every page change.
    // To listen for when this page is active (for example, to refresh data),
    // listen for the $ionicView.enter event:
    //$scope.$on('$ionicView.enter', function(e) {
    //});
  
     // Form data for the login modal
      $scope.loginData = $localStorage.getObject('userinfo','{}');
      $scope.reservation = {};
      $scope.registration = {};
      $rootScope.currentUser = false;
      $rootScope.username = '';
      $rootScope.admin = false;
      $rootScope.uid = '';
      $rootScope.isVerified = false;
  
      if(AuthFactory.isAuthenticated()) {
        $rootScope.currentUser = true;
        $rootScope.username = AuthFactory.getUsername();
        $rootScope.admin = AuthFactory.isAdmin();
        $rootScope.isVerified = AuthFactory.isVerified();
        $rootScope.uid = AuthFactory.uid();
      }
  
      // Create the login modal that we will use later
      $ionicModal.fromTemplateUrl('templates/login.html', {
          scope: $scope
      }).then(function (modal) {
          $scope.modal = modal;
      });
  
      // Triggered in the login modal to close it
      $scope.closeLogin = function () {
          $scope.modal.hide();
      };
  
      // Open the login modal
      $scope.login = function () {
          $scope.modal.show();
      };
  
      // Perform the login action when the user submits the login form
      $scope.doLogin = function () {
          console.log('Doing login', $scope.loginData);
          $localStorage.storeObject('userinfo',$scope.loginData);
          AuthFactory.login($scope.loginData);
          $scope.closeLogin();
      };
  
      $scope.logout = function() {
          AuthFactory.logout();
          $rootScope.currentUser = false;
          $rootScope.username = '';
          $rootScope.admin = false;
          $rootScope.isVerified = false;
          $rootScope.uid = '';
          $state.go("app");
      };
  
      // On successful login
      $rootScope.$on('login:Successful', function () {
          $rootScope.currentUser = AuthFactory.isAuthenticated();
          $rootScope.username = AuthFactory.getUsername();
          $rootScope.admin = AuthFactory.isAdmin();
          $rootScope.uid = AuthFactory.uid();
          $rootScope.isVerified = AuthFactory.isVerified();
      });
  
      // Create the login modal that we will use later
      $ionicModal.fromTemplateUrl('templates/register.html', {
          scope: $scope
      }).then(function (modal) {
          $scope.registerform = modal;
      });
  
      // Triggered in the login modal to close it
      $scope.closeRegister = function () {
          $scope.registerform.hide();
      };
  
      // Open the login modal
      $scope.register = function() {
          $scope.registerform.show();
      };
  
      // Perform the login action when the user submits the login form
      $scope.doRegister = function() {
          console.log('Doing registration', $scope.registration);
          $scope.loginData.username = $scope.registration.username;
          $scope.loginData.password = $scope.registration.password;
  
          AuthFactory.register($scope.registration);
          // Simulate a login delay. Remove this and replace with your login
          // code if using a login system
          $timeout(function () {
              $scope.closeRegister();
          }, 1000);
      };
  
      // On successful registration
      $rootScope.$on('registration:Successful', function () {
          $rootScope.currentUser = AuthFactory.isAuthenticated();
          $rootScope.username = AuthFactory.getUsername();
          $rootScope.admin = AuthFactory.isAdmin();
          $rootScope.uid = AuthFactory.uid();
          $rootScope.isVerified = AuthFactory.isVerified();
      });
  
      $scope.toggleLeft = function() {
          $ionicSideMenuDelegate.toggleLeft();
        };
  }]);
  </code></pre>