title: Why ng-transclude's scope is not a child of its directive's scope - if the directive has an isolated scope?
body: <p>Given a directive (<code>container1</code>) with transclude and an isolated scope, when the directive is linked then I have these scopes:</p>
  
  <pre><code>Scope 004           &lt;-- scope of the body
      Scope 005       &lt;-- scope of directive container1
      Scope 006       &lt;-- scope of the ng-transclude
  </code></pre>
  
  <p>I expected:</p>
  
  <pre><code>Scope 004            &lt;-- scope of the body
      Scope 005        &lt;-- scope of the directive
           Scope 006   &lt;-- scope of the ng-transclude
  </code></pre>
  
  <p>If the same directive has a <em>shared scope</em> instead of an <em>isolated scope</em>, I get the expected result.</p>
  
  <p>This causes me a problem because, if the transcluded content contains another directive (<code>component1</code>) with an isolated scope, I get:</p>
  
  <pre><code>Scope 004             &lt;-- scope of the body
      Scope 005         &lt;-- scope of the directive
      Scope 006         &lt;-- scope of the ng-transclude
            Scope 007   &lt;-- scope of directive component1
  </code></pre>
  
  <p>I want to use the directives like this:</p>
  
  <pre><code>&lt;container1&gt;
     &lt;component1 data="objectExposedInContainer1"/&gt;
  &lt;/container1&gt;
  </code></pre>
  
  <p>But that does not work, inside <code>component1</code>, <code>$scope.data</code> is <code>undefined</code> because <code>objectExposedInContainer1</code> is not on the right scope.</p>
  
  <p>I have two questions:</p>
  
  <ul>
  <li>Why <code>ng-transclude</code>'s scope is not a child of its directive's scope if the directive has an isolated scope? Is this a bug?</li>
  <li>If it's not a bug, how can a container directive pass data to it's content, if not by setting attributes like I tried.</li>
  </ul>
  
  <p>Here is a sample where it does not work: <a href="http://plnkr.co/edit/NDmJiRzTF9e5gw8Buht2?p=preview">http://plnkr.co/edit/NDmJiRzTF9e5gw8Buht2?p=preview</a>. Because Plunker is built with Anguar, it's hard to debug with Batarang. I recommend downloading the code locally. Comment out <code>line 10</code> of <code>app.js</code> to make it work using a shared scope.</p>