title: Load directive after AJAX call
body: <p>I have build a directive for pagination that takes two arguments; the current page and the total number of pages.</p>
  
  <p><code>&lt;pagination page="page" number-of-pages="numberOfPages"&gt;&lt;/pagination&gt;</code></p>
  
  <p>The issue is that I will only know the value of numberOfPages after an AJAX call (through ng-resource). But my directive is already rendered before that the AJAX call is done.</p>
  
  <pre><code>app.controller('MyController', function ($scope, $routeParams) {
      $scope.page = +$routeParams.page || 1,
      $scope.numberOfPages = 23; // This will work just fine
  
      MyResource.query({
          "page": $scope.page,
          "per_page": 100
      }, function (response) {
          //This won't work since the directive is already rendered
          $scope.numberOfPages = response.meta.number_of_pages;
      });
  });
  </code></pre>
  
  <p>I prefer to wait with the rendering of my controllers template until the AJAX call is finished.</p>
  
  <p>Plan B would be to append the template with the directives template when the AJAX call is done.</p>
  
  <p>I'm stuck working out both scenarios.</p>