title: How can I get a handle on ng-repeat children elements in my custom directive?
body: <p>I am trying to build a custom directive that rearrange its content as a grid.
  I want to transclude the result of an <code>ng-repeat</code> directive and then reorder the resulting elements.</p>
  
  <p>The problem is when I call the <code>element.children()</code> method inside the link function, I have an empty array because the <code>ng-repeat</code> directive is not yet rendered and is interpreted as a comment.</p>
  
  <p>Otherwise, the directive works great if its content is 'static'.</p>
  
  <p>The HTML</p>
  
  <pre><code>&lt;grid n='6'&gt;
      &lt;div ng-repeat="i in [1,2,3]"&gt;&lt;/div&gt;
  &lt;/grid&gt;
  </code></pre>
  
  <p>My directive with only the interesting pieces of code:</p>
  
  <pre><code>app.directive('grid', [function () {
      return {
  
          restrict: 'E',
          replace: true,
          transclude: true,
          template: "&lt;div ng-transclude&gt;&lt;/div&gt;",
  
          link: function (scope, grid, attrs) {
  
              // With an ngRepeat transcluded, els result in an empty array
              var els = grid.children();
  
              // ...
      }; 
  }]);
  </code></pre>
  
  <p>What am I missing ?</p>