title: Is it possible to 'transclude' while keeping the scope of the directive in Angular?
body: <p>Is possible to do the following in Angular?</p>
  
  <pre class="lang-html prettyprint-override"><code>&lt;div ng-controller="MainCtrl" ng-init="name='World'"&gt;
      &lt;test name="Matei"&gt;Hello {{name}}!&lt;/test&gt; // I expect "Hello Matei"
      &lt;test name="David"&gt;Hello {{name}}!&lt;/test&gt; // I expect "Hello David"
  &lt;/div&gt;
  </code></pre>
  
  <p>My directive is simple but it's not working:</p>
  
  <pre class="lang-js prettyprint-override"><code>app.directive('test', function() {
    return {
      restrict: 'E',
      scope: {
        name: '@'
      },
      replace: true,
      transclude: true,
      template: '&lt;div class="test" ng-transclude&gt;&lt;/div&gt;'
    };
  });
  </code></pre>
  
  <p>I also tried to use the transclude function to change the scope and it works. The only problem is that I loose the template.</p>
  
  <pre><code>app.directive('test', function() {
    return {
      restrict: 'E',
      scope: {
        name: '@'
      },
      transclude: true,
      template: '&lt;div class="test" ng-transclude&gt;&lt;/div&gt;',
      link: function(scope, element, attrs, ctrl, transclude) {
        transclude(scope, function(clone) {
          element.replaceWith(clone);
        });
      }
    };
  });
  </code></pre>
  
  <p>Is it possible to do this while keeping the template in place and clone to be appended into the element with <code>ng-transclude</code> attribute?</p>
  
  <p>Here is a Plnkr link you could use to test your solution: <a href="http://plnkr.co/edit/IWd7bnhzpLmlBpoaoJct?p=preview" rel="nofollow noreferrer">http://plnkr.co/edit/IWd7bnhzpLmlBpoaoJct?p=preview</a></p>