DOM not rendered when executing run block

I want to show a "Loading..." message while loading json data in my AngularJS app. Showing the message and loading the data is done in my main module's run block. The problem is that the browser hasn't rendered the DOM when the run block is executed so the message is not shown. When exactly is the run block executed? How could I achieve what I want: first show the page, then start loading data and display a message?

My code is here: www.esatoivola.net/kirkkovuosi

"When exactly is the run block executed?"

Run blocks - get executed after the injector is created and are used to kickstart the application. Only instances and constants can be injected into run blocks. This is to prevent further system configuration during application run time. -- Module docs

.

"How could I ... first show the page, then start loading data and display a message?"

You could use ng-show and a $scope or $rootScope property (initially set to true) to control showing the "Loading" message. Your main controller can load the data, and when the data comes back, set some $scope property tied to the view and set the "showLoadingMessage" property to false.

HTML:

<div ng-controller="MyCtrl">
  <div ng-show="showLoadingMessage">Loading... </div>
  <ul>
     <li ng-repeat="item in data">
        ....
     </li>
  </ul>
</div>

Controller:

function MyCtrl($scope, $resource) {
    $scope.showLoadingMessage = true;
    var dataResource = $resource('/somewhere/else');
    dataResource.query( function(data) {
       $scope.showLoadingMessage = false;
       $scope.data = data; 
    });
}