title: Access parent controller methods from directive?
body: <p>I have a question with some page about item search.</p>
  
  <p>Let's say I have:</p>
  
  <ol>
  <li>A <strong>controller</strong> with <strong>result items to display</strong></li>
  <li>A <strong>service</strong> that performs the search queries and interacts to the controller so it updates the <strong>result items to display</strong></li>
  <li>A <strong>directive</strong> which has the <strong>form</strong> with all the inputs of the search fields.</li>
  </ol>
  
  <p>One of the buttons is a "View more items" button. It should only be shown if the response that I receive from a query tells me that there are more items to view.</p>
  
  <p>I made a function inside the <strong>service</strong> which checks this property and returns a boolean to the <strong>directive</strong> which uses it with a ng-show on the button to show or hide it.</p>
  
  <p>The problem is that I don't know how to interact with the <strong>controller</strong> within this scope. </p>
  
  <p>Should the <strong>directive</strong> call one <strong>service method</strong> and this method should interact with the <strong>controller</strong> in some way?</p>
  
  <p>Before this I was wrapping the directive with a form tag (outside the directive's scope) and then I could use the ng-submit to perform some action on the <strong>controller</strong> to call the <strong>service</strong>. Like this:</p>
  
  <pre><code>&lt;form ng-submit="myController.submitSearch"&gt;
      &lt;search-options-directive&gt;&lt;/search-options-directive&gt;
      &lt;button type="submit"&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>But now what I'm trying to do is to put the form and the buttons inside the </p>
  
  <pre><code>&lt;search-options-directive&gt;&lt;/search-options-directive&gt;
  </code></pre>
  
  <p>So now I don't have access to call <strong>controller</strong> methods directly.</p>
  
  <p>How should I approach this?</p>