title: AngularJS : How to pass data from directive to controllers function
body: <p>I'm trying to pass some data from directive into a function <code>addTrackFromPicker</code> in my controller.</p>
  
  <pre><code>$scope.addTrackFromPicker = function (message) {
      console.log("addTrackFromPicker", message);
  };
  </code></pre>
  
  <p>Here what I have in my directive</p>
  
  <pre><code>dir.directive('youtubeList', function($http, $timeout, YT_event){
      return {
          restrict: 'E',
          scope: {
              search: '=',
              dial: '&amp;'
          },
          templateUrl: 'youtube-list.html',
  ...
  </code></pre>
  
  <p>Here I want to call controllers function from my template and pass it <code>item.id.$t</code> as argument:</p>
  
  <pre><code>&lt;div class="media list-group-item" ng-repeat="item in entries"&gt;
  &lt;a type="button" ng-click="dial(item.id.$t)"&gt;
      &lt;img  ng-src="{{item.media$group.media$thumbnail[0].url}}"&gt;
  &lt;/a&gt;
  </code></pre>
  
  <p>
  But I don't know how to pass it into my tag</p>
  
  <p><code>&lt;youtube-list search="search" dial="addTrackFromPicker(???)"&gt;&lt;/youtube-list&gt;</code></p>
  
  <p>I also tried <code>$parent.addTrackFromPicker</code> but it didnt work</p>