title: Ionic, Cordova, Phonegap loading message
body: <p>I'm developing an app using the ionic framework with angular.js and I am finding my loading messages are disappearing before my content has loaded - here is some example code</p>
  
  <pre><code>$scope.validateUser = function () {
      var email = this.user.email;
      var password = this.user.password;
      if(!email || !password) {
          $rootScope.notify("Please enter valid credentials");
          return false;
      }
      $rootScope.show('Please wait.. Authenticating');
      API.signin({
          email: email,
          password: password
      }).success(function (data) {
          $rootScope.setToken(email); // create a session kind of thing on the client side
          $rootScope.hide();
          $window.location.href = ('#/database/list');
      }).error(function (error) {
          $rootScope.hide();
          $rootScope.notify("Invalid Username or password");
      });
  }
  </code></pre>
  
  <p>The '#database/list' is grabbed from a RESTful API and the authenticating message vanishes before the page is rended in the app.</p>
  
  <p>Am I right in thinking I should move the $rootScope.hide() to below the $window.location.href line, or is it something more sinister (i.e. I have warnings that $rootScope.hide() is depreciated and I should use $ionicLoading.hide();</p>
  
  <p>I'm very new to Angular and app development (primarly PHP dev) so any help would be greatly appreciated.</p>