title: AngularJS transclude scope in directive with ng-repeat
body: <p>My goal is to have a directive, which I give contents to, and it repeats them X times. Just like ng-repeat, only I want to wrap it in other features such as limit toggle and extra elements outside the transcluded content.</p>
  
  <p>For some reason, the transclusion has no access to the directive isolate scope, no matter what I try.</p>
  
  <p>I've used the <code>transclude</code> function inside <code>link</code>, in several variations, to no avail. Here's a demo:</p>
  
  <ul>
  <li><a href="https://plnkr.co/edit/XCmyanWvfmC25IhHoJzS?p=preview" rel="nofollow">Plunkr</a> </li>
  </ul>
  
  <p>And here's the gist of the code:</p>
  
  <pre><code>app.directive('repeatContents', function() {
    return {
      scope: {
        items: '=repeatContents',
        limit: '=repeatLimit'
      },
      transclude: true,
      template: '&lt;div ng-repeat="item in items"&gt;' +
                    '&lt;em&gt;Outside transclude: {{item}}&lt;/em&gt;&lt;br /&gt;' +
                    '&lt;ng-transclude&gt;&lt;/ng-transclude&gt;' +
                '&lt;/div&gt;',
      link: function(scope, el, attrs, ctrl, transclude) {
        transclude(scope, function(clone, scope) {
          el.append(clone);
        });
      }
    }
  });
  </code></pre>
  
  <p>If you look at the plunkr, you will see that outside the transclusion <code>{{item}}</code> is available, but not inside. Regardless of the <code>link</code> function's contents which were supposed to take care of it. Any idea what I can do?</p>