title: Pass Arguments from directive to controller function
body: <p>I've seen lots of these questions but haven't found a solution that works. here is a fiddle that doesn't work but should.</p>
  
  <p><a href="http://jsfiddle.net/cdparmeter/j2K7N/2/" rel="noreferrer">http://jsfiddle.net/cdparmeter/j2K7N/2/</a></p>
  
  <p>Controller:</p>
  
  <pre><code>$scope.foo = function (textArray) {
      console.log(textArray)
  };
  </code></pre>
  
  <p>Directive:</p>
  
  <pre><code>return {
      restrict: 'E',
      replace: 'true',
      scope: {
          methodToCall: '&amp;method'
      },
      template: "&lt;div&gt;
          &lt;input ng-model='textToPush'/&gt;
          &lt;button ng-click='pushText'&gt;Push&lt;/button&gt;
          &lt;button ng-click='finish'&gt;Finish&lt;/button&gt;
      &lt;/div&gt;",
      link: function (scope, element, attrs) {
          scope.paragraphs = [];
          scope.pushText = function () {
              scope.paragraphs.push(scope.pushText);
              scope.pushText = "";
          }
          scope.finish = function () {
              scope.methodToCall(scope.paragraphs)
          }
      }
  }
  </code></pre>
  
  <p>HTML:</p>
  
  <pre><code>&lt;div ng-app="MyApp"&gt;
      &lt;div ng-controller="MyController"&gt;
          &lt;container data-method="foo"&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>I'm building an array inside my directive that needs custom handling in the controller of the parent scope. I know I can throw a watch in the parent scope on a model I pass into my directive but that seems hackish and dirty. any suggestions?</p>