title: How to read Javascript object from the server before the page is rendered
body: <p>My page works with directives that interface to an object ' invoice ' defined only on the server.</p>
  
  <p>I want to know what is the best way to stop the rendering of the page to complete loading the object , in order to avoid error ' undefined ' of object properties..</p>
  
  <pre><code>     angular.module("adocApp")
        .controller("ctrl",
           function ($scope, $http ) {
  
  
              $scope.loadingIsDone = false; //variable that stop rendering of page
  
  
          $http.get("Home/init").success(function (data) {
              $scope.invoice = data;
              $scope.loadingIsDone = true; //this start rendering with ng-if... but seems bad solution
                     });
  
  
      });
  </code></pre>