title: How can I set a form contained inside a ng-include to be prestine?
body: <p>I have the following code:</p>
  
  <pre class="lang-html prettyprint-override"><code>&lt;div modal="modal.shouldBeOpen" close="close()" options="opts"&gt;
      &lt;div class="modal-body"&gt;
          &lt;form novalidate name="itemForm" style="margin-bottom: 0px;"&gt;
  </code></pre>
  
  <p>Which is contained inside the included file modal.html</p>
  
  <pre class="lang-html prettyprint-override"><code>&lt;div data-ng-controller="AdminController"&gt;
     &lt;ng-include src="'/Content/app/admin/partials/grid-subject.html'"&gt;&lt;/ng-include &gt;
     &lt;ng-include src="'/Content/app/admin/partials/modal.html'"&gt;&lt;/ng-include&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>In my AdminController controller I am trying to use the following code to reset the form to pristine:</p>
  
  <pre class="lang-js prettyprint-override"><code>$scope.itemForm.$setPristine();
  </code></pre>
  
  <p>When I do this it tells me that "itemForm" is undefined. </p>
  
  <p>Is there a way I can set the contents of the form to pristine. I assume this is a scope problem but I am not sure how to fix it. I 
  tried the one solution of removing the second include and pasting the code in directly. This solution works. </p>
  
  <p>However we want to be able to reuse code
  so I would like to be able to do this with an include for modal.html</p>
  
  <p>Note that the reason we would like to do this is because we have something like the following on our modal.html:</p>
  
  <pre><code>    &lt;button
          class="btn float-right"
          data-ng-disabled="itemForm.$pristine"
          data-ng-click="modalReset()"
          data-ng-show="modal.resetButton"&gt;
          Reset&lt;/button&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>So we are actually inside of the itemForm and would like to set it to $pristine from the button inside.</p>