title: Scope hierarchy issues after upgrading to Angular 1.2.1
body: <p>We recently upgraded to Angular 1.2.1 and are experiencing some issues with ng-include.</p>
  
  <p>Here's a simplified example that shows our usage in Angular 1.1.1:<br/>
  <a href="http://jsfiddle.net/Dq57j/1/" rel="nofollow">http://jsfiddle.net/Dq57j/1/</a></p>
  
  <p>And here's another fiddle with Angular 1.2.1 with a workaround to our problem:<br/>
  <a href="http://jsfiddle.net/78FJJ/4/" rel="nofollow">http://jsfiddle.net/78FJJ/4/</a></p>
  
  <p>--HTML snip below--</p>
  
  <pre><code>   &lt;div ng-controller="RootCtrl" id="a"&gt;
        Hello, {{name}}!
  
        &lt;!-- does not work in Angular 1.2.1 --&gt;
        &lt;!--div ng-controller="TemplateCtrl" id="b"
             ng-include src="'template.html'"&gt;
        &lt;/div--&gt;
  
        &lt;!-- workaround --&gt;
        &lt;div ng-controller="TemplateCtrl" id="b"&gt;
            &lt;div ng-include src="'template.html'"&gt;
            &lt;/div&gt;  
     &lt;/div&gt;
  </code></pre>
  
  <p>If you <strong>comment out</strong> the workaround and run the original code, this example will not work as expected, i.e. it outputs "Template saying:". It seems as though the template cannot read the scope initialized by TemplateCtrl.</p>
  
  <p>If you investigate the issue further outside of jsfiddle and closely observe the scopes generated (e.g. using Batarang) you will see that the following scope hierarchy is generated (where the scope names reflect the id of the corresponding div):</p>
  
  <p>a<br/>
  |_ c<br/>
  &nbsp;&nbsp;&nbsp;&nbsp;|_ b<br/></p>
  
  <p>To me this seems really strange. How can Angular twist the scope hierarchy which according to me should be <em>a->b->c</em>? Note that the reason this example works in v.1.1.1 is that the hierarchy is <em>a->b->c</em> in that version of Angular.</p>
  
  <p>Can anyone explain this and exactly what got changed between the two version?</p>