title: How to transclude inside directive by hand into 2 places?
body: <p>I need to have access to result of <code>ng-repeat</code>, I've found that I can use <code>transclude</code> function and compile by hand. But the problem is that it don't work with 2 places and with element that have <code>ng-repeat</code>. My code like like this:</p>
  
  <pre><code>return {
      restrict: 'E',
      require: '?ngModel',
      template: 'HTML'
      transclude: true,
      replace: true,
      link: function(scope, element, attrs, ngModelCtrl, $transclude) {
          var caption = element.find('.caption');
          var dropdown = element.find('.dropdown-menu');
          $transclude(function(clone) {
  
              //var clone_clone = clone.addClass('ng-hide');
              //$compile(clone.contents())(scope.$new()).appendTo(caption);
  
              $compile(clone)(scope.$new()).appendTo(dropdown);
              $compile(clone)(scope.$new()).appendTo(caption);
          });
      }
  };
  </code></pre>
  
  <p>it work when I run only one compile but throw exception on the second, I've try to <code>clone()</code> also use <code>contents()</code> with <code>transclude: 'element'</code>. How can I do this? I need to have same behavior as with <code>ng-transclude</code> (<code>ng-translcude</code> don't work with <code>ng-repeat</code> because inside link I have one element instead of list of elements).</p>
  
  <p><strong>UPDATE</strong>: usage:</p>
  
  <pre><code>&lt;dropdown&gt;
    &lt;li&gt;&lt;a&gt;foo&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;&lt;a&gt;bar&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;&lt;a&gt;baz&lt;/a&gt;&lt;/li&gt;
  &lt;/dropdown&gt;
  
  &lt;dropdown&gt;
    &lt;li ng-repeat="item in items"&gt;&lt;a&gt;{{item.label}}&lt;/a&gt;&lt;/li&gt;
  &lt;/dropdown&gt;
  </code></pre>