title: ionic view is not cached, controller reloads
body: <p>I have an ionic app with some views, when I start the app I will go to my main view, when the controller of the view is initialized I will load some data.</p>
  
  <p>The problem is, when I navigate from that view, using tabs, that controller is <strong>sometimes</strong> destroyed, so when I navigate back the data will have to load again.</p>
  
  <p>I have done some testing with <em>'$ionicView.loaded'</em> and <em>'$ionicView.unloaded'</em> and it seems to be pretty random when the view is unloaded.</p>
  
  <p>This is my state configuration</p>
  
  <pre><code>.config(function($stateProvider, $urlRouterProvider) {
  
  $stateProvider
  
    .state('login', {
      name: "login",
      url: "/login",
      templateUrl: "templates/login.html",
      controller: 'loginCtrl'
    })
  
    // This is a sidemenu
    .state('app', {
      url: '/app',
      abstract: true,
      templateUrl: 'templates/menu.html'
    })
  
    .state('app.hms', {
      url: '/hms',
      views: {
        'menuContent': {
          templateUrl: 'templates/hms-app.html',
          controller: 'HmsCtrl'
        }
      }
    })
  
    .state('app.hms-item', {
      url: '/hms/:hmsId',
      views: {
        'menuContent': {
          templateUrl: 'templates/hms-item.html',
          controller: 'HmsItemCtrl'
        }
      },
      params: {
        item: null
      }
    })
  
    .state('app.history', {
      url: '/history',
      views: {
        'menuContent': {
          templateUrl: 'templates/history-list.html',
          controller: 'HistoryCtrl'
        }
      }
    })
    .state('app.history-item', {
      url: '/history/:itemId',
      views: {
        'menuContent': {
          templateUrl: 'templates/history-item.html',
          controller: 'HistoryItemCtrl'
        }
      },
      params: {
        itemId: null
      }
    })
  
    .state('app.event-new', {
      url: '/event/new',
      views: {
        'menuContent': {
          templateUrl: 'templates/event-new.html',
          controller: 'EventCtrl as ctrl'
        }
      }
    })
  
    .state('app.risk-new', {
      url: '/risk/new',
      views: {
        'menuContent': {
          templateUrl: 'templates/risk-new.html',
          controller: 'RiskCtrl as ctrl'
        }
      }
    });
  
  
  // if none of the above states are matched, use this as the fallback
  // this is also the first page, 'front page'
  $urlRouterProvider.otherwise('login');
  
  });
  </code></pre>
  
  <p>My tabs are defined in each .html template I need them in (so not the login page, for instance), they are defined after the closing of ion-content:</p>
  
  <pre><code>  &lt;div class="tabs tabs-icon-top"&gt;
  &lt;a class="tab-item" href="#/app/hms"&gt;
    &lt;i class="icon ion-home"&gt;&lt;/i&gt;
    Home
  &lt;/a&gt;
  &lt;a class="tab-item" href="#/app/event/new"&gt;
    &lt;i class="icon ion-document-text"&gt;&lt;/i&gt;
    Hendelse
  &lt;/a&gt;
  &lt;a class="tab-item" href="#/app/risk/new"&gt;
    &lt;i class="icon ion-document-text"&gt;&lt;/i&gt;
    Risikorapport
  &lt;/a&gt;
  &lt;a class="tab-item" href="#/app/history"&gt;
    &lt;i class="icon ion-ios-list"&gt;&lt;/i&gt;
    Historikk
  &lt;/a&gt;
  </code></pre>
  
  <p></p>
  
  <p>What could cause the controller of the view to be destroyed when I navigate from it? </p>