title: Ionic/AngularJs Controller Initialization ng-init doesn't work
body: <p>Onced logged my controller initialization script doesn't invoke:</p>
  
  <p>Go to <a href="https://billiving-qa.azurewebsites.net/accountant" rel="nofollow">https://billiving-qa.azurewebsites.net/accountant</a> 
  email: qa@billiving.com 
  pass: 111111</p>
  
  <p>When going to manage accounts the drop down list is empty. If you refresh (hit f5) the list gets populated. Then if you go into incognito or delete cache and reload the page the list is empty again.</p>
  
  <p>It seems that the initialization is invoked late in the lifetime of my single-page-application.</p>
  
  <p>Here's my code:</p>
  
  <pre><code>&lt;ion-view hide-back-button="true" ng-controller="DashboardCtrl" ng-init="Initialize()"&gt;
  
  
    &lt;ion-nav-title align-title="center"&gt;
  
  
  
    &lt;select ng-options="account.Key as account.Name for account in accounts" ng-change="LoadAccount(account)" 
    ng-model="account.Key"&gt;
  &lt;option value='' disabled selected&gt;Select Account..&lt;/option&gt;
  &lt;/select&gt;
  
  &lt;a style="cursor: pointer" ng-click="Initialize()"&gt;Refresh&lt;/a&gt;
  
  
    &lt;/ion-nav-title&gt;
  
    &lt;ion-nav-buttons side="right"&gt;
  
    &lt;/ion-nav-buttons&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-content class="page page-dashboard is-pad" style="height:100%"&gt;
  
  
  &lt;iframe frameborder="5" class="frm" ng-src="{{trustSrc(url)}}" scrolling="yes"&gt;&lt;/iframe&gt;
  
  
    &lt;/ion-content&gt;
  &lt;/ion-view&gt;
  </code></pre>
  
  <p>Here's the angularjs code:</p>
  
  <pre><code>angular.module('myApp.controllers')
  
      .controller('DashboardCtrl', function ($scope, $http, AppConfig, Utils, AuthService, $state, $sce) {
            Utils.hideIndicator();
            if (!AuthService.isLoggedIn()) {
              $state.go('app.login');
              return;
      }
  
      $scope.accounts = {};
      $scope.account ={};
      $scope.url = 'about:blank';
  
      if (localStorage.SelectedKey!=null){
        $scope.account.Key = localStorage.SelectedKey;
        SetAccount($scope.account);
      }
  
  
      $scope.Initialize = function(){
  
  
  
        Utils.showIndicator();
        $http.get(AppConfig.endpoint + 'accountants/accounts')
                          .then(function (response) {
                            $scope.accounts = response.data;
  
                            if ($scope.accounts.length==0)
                              $state.go('app.register');
  
                            Utils.hideIndicator();
                          });
      };
  
  
      $scope.LoadAccount = function(account){
            SetAccount(account);
      };
  
      function SetAccount(account) {
            $scope.url = AppConfig.BaseAccount + "/Users/Index.aspx?userkey=" + account.Key;
            localStorage.SelectedKey = account.Key;
      }
  
      $scope.trustSrc = function(src) {
          return $sce.trustAsResourceUrl(src);
      }
  
  
  
  });
  </code></pre>