title: Difference in scope between directive with template and without template AND between Angular 1.2 and 1.1?
body: <p>I am new to Angular and trying to understand advanced directive API - I want to re-create directive template in compile function using directive element attributes.
  But when I don't have a template set (or template is empty string) instead accesing isolated directive scope I access parent (controller) scope. Also - this works on Angular 1.1 but not 1.2</p>
  
  <p>here is HTML:</p>
  
  <pre><code>&lt;div class="container" ng-app="app" ng-controller="AppController"&gt;
        &lt;sandbox title="Attribute Title"&gt;&lt;/sandbox&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>JavaScript:</p>
  
  <pre><code>var app = angular.module('app', [], function () {});
  
  app.controller('AppController', function ($scope) {
      $scope.title = "AppController title";
  });
  
  app.directive('sandbox', function ($log, $compile) {
      return {
          restrict: 'E',
          scope: {
              title: "@"
          },
          controller: function ($scope, $element, $attrs) {
              $scope.title = "Directive Controller title";
          },
          template: '&lt;h1&gt;Template&lt;/h1&gt;', // change it to: '' and Run, than change Angular to 1.2.x
          compile: function (tElement, tAttrs) {
              tElement.append('&lt;h2&gt; Title = {{ title }}&lt;/h2&gt;');
          }
      }
  
  });
  </code></pre>
  
  <p>When you Run it you get:</p>
  
  <p><strong>Template</strong></p>
  
  <p><strong>Title = Attribute Title</strong></p>
  
  <p>But when you change template to empty string you get with Angular 1.2:</p>
  
  <p><strong>Title = AppController Title</strong></p>
  
  <p>And with Angular 1.1.1:</p>
  
  <p><strong>Title = Attribute Title</strong></p>
  
  <p>My Questions:</p>
  
  <p><strong>Why there is a difference in accesing scope when template is set AND when it's not set?</strong></p>
  
  <p><strong>Why there is a difference between Angular 1.1 and 1.2 (bug? - directive without 'template'and with isoleted scope acceses controller scope not directive scope ) ?</strong></p>
  
  <p><strong>How can I build template that accesses isolated scope NOT parent scope in Angular 1.2 in compile function ?</strong></p>
  
  <p><strong>Why directive controller function does not change 'title' using $scope.title = "..." - but when debugging 'scope' param in 'link' function 'title' value is 'Directive Controler Title' but it internally (WHERE to look for it) binds isoleted scope 'Attribute Value'  ?</strong></p>
  
  <p>Here is JSFiddle to play with: <a href="http://jsfiddle.net/yoorek/zQ66L/4/" rel="nofollow">http://jsfiddle.net/yoorek/zQ66L/4/</a></p>