title: Pass callback function to directive
body: <p>I'm trying to pass a callback function from a controller to a directive.</p>
  
  <p>Here's the callback function code:</p>
  
  <pre><code>$scope.onImageSelect = function(image) {
      alert('SET');
      $scope.card.image = image;
  };
  </code></pre>
  
  <p>Directive usage:</p>
  
  <pre><code>&lt;google-image-search callback="onImageSelect" /&gt;
  </code></pre>
  
  <p>Directive code:</p>
  
  <pre><code>ngmod.directive('directive', function() {
      return {
          templateUrl: '/templates/template.html',
          scope: {
              callback: '&amp;'
          }
      }
  });
  </code></pre>
  
  <p>Callback usage in template:</p>
  
  <pre><code>&lt;a data-ng-click="callback(url)"&gt;&lt;/a&gt;
  </code></pre>
  
  <p>However, this gives me the following error:</p>
  
  <pre><code>TypeError: Cannot use 'in' operator to search for 'onImageSelect'
  </code></pre>
  
  <p>I've seen a lot of similar questions, but could not understand where am I wrong. </p>