AngularJS: Passing function to directive
<p>I got a problem by passing a function to a directive ( familiar to this post: <a href="https://stackoverflow.com/questions/18378520/angularjs-pass-function-to-directive">AngularJS - pass function to directive</a> but i can´t get it working)</p>

<p>Here is my Code:</p>

<p>Directive:</p>

<pre><code>.directive('testdirective', function(){
  return{
    restrict: 'E',
    scope: {
      onClick: '&amp;'
    },
    controller: 'TestController',
    controllerAs: 'tc',
    bindToController: true,
    template: '&lt;div&gt;&lt;button ng-click="onClick()"&gt;What UP&lt;/button&gt;&lt;/div&gt;',
    replace: true
  }
})
</code></pre>

<p>Controller:</p>

<pre><code>  TestController.$inject = ["$scope"];
  function TestController($scope) {
    $scope.testFunction = function(){
      alert("I´m the alert of the TestContoller");
    };
    $scope.test = 'test';
  }
</code></pre>

<p>HTML:</p>

<pre><code>&lt;div&gt;
  &lt;testdirective on-click="testFunction()"&gt;&lt;/testdirective&gt;
&lt;/div&gt;
</code></pre>

<p>What I want sounds very simple, I just want to pass the function to the directive and execute it with the ng-click on the button.</p>

<p>For me my code looks exactly <a href="http://jsfiddle.net/mygknek2/" rel="nofollow noreferrer">like this fiddle</a>
but mine is not working :/</p>

<p>Would be awesome if someone got some hints for me.</p>

<p><strong>EDIT</strong>  </p>

<blockquote>
  <p>My directive will need his own controller !     </p>
  
  <p>Later the function to be passed in will come from another controller !!!</p>
</blockquote>