title: Can an angular directive pass arguments to functions in expressions specified in the directive's attributes?
body: <p>I have a form directive that uses a specified <code>callback</code> attribute with an isolate scope:</p>
  
  <pre><code>scope: { callback: '&amp;' }
  </code></pre>
  
  <p>It sits inside an <code>ng-repeat</code> so the expression I pass in includes the <code>id</code> of the object as an argument to the callback function:</p>
  
  <pre><code>&lt;directive ng-repeat = "item in stuff" callback = "callback(item.id)"/&gt;
  </code></pre>
  
  <p>When I've finished with the directive, it calls <code>$scope.callback()</code> from its controller function. For most cases this is fine, and it's all I want to do, but sometimes I'd like to add another argument from inside the <code>directive</code> itself.</p>
  
  <p>Is there an angular expression that would allow this: <code>$scope.callback(arg2)</code>, resulting in <code>callback</code> being called with <code>arguments = [item.id, arg2]</code>?</p>
  
  <p>If not, what is the neatest way to do this? </p>
  
  <p>I've found that this works:</p>
  
  <pre><code>&lt;directive 
    ng-repeat = "item in stuff" 
    callback = "callback" 
    callback-arg="item.id"/&gt;
  </code></pre>
  
  <p>With</p>
  
  <pre><code>scope { callback: '=', callbackArg: '=' }
  </code></pre>
  
  <p>and the directive calling </p>
  
  <pre><code>$scope.callback.apply(null, [$scope.callbackArg].concat([arg2, arg3]) );
  </code></pre>
  
  <p>But I don't think it's particularly neat and it involves puting extra stuff in the isolate scope.</p>
  
  <p>Is there a better way?</p>
  
  <p><a href="http://plnkr.co/edit/CcaqZZM17T0c2gRfQrFV?p=preview">Plunker playground here</a> (have the console open).</p>