title: Angular 1.5 Components with Form and $setPristine
body: <p>I'm trying to use a form within a component in Angular 1.5</p>
  
  <p>I have the form working, in that I have model binding and can get to the data on submit. So I'm 90% of where I want to be, what's missing is being able to reset the form correctly using $setPristine.</p>
  
  <p>I've attempted a couple of approaches the first was passing in the form as an argument to the reset function. </p>
  
  <p>form.html</p>
  
  <pre><code>&lt;form name="$ctrl.userForm"&gt;
    ...
    &lt;input class="btn btn-default" type="button" ng-click="$ctrl.reset($ctrl.userForm)" value="Reset" /&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>form.component.js</p>
  
  <pre><code>ctrl.reset = function(userForm) {
      ctrl.user = {};
      userForm.$setPristine // Cannot read property '$setPristine' of undefined
  };
  </code></pre>
  
  <p><a href="http://plnkr.co/edit/0mqPcq6gwav9JKQkgkfP?p=preview" rel="nofollow noreferrer">Full code in Plnkr</a> </p>
  
  <p>I also tried declaring $ctrl.userForm as an empty object $onInit, but that didn't seem to work either. With the $setPristine line removed the reset works in clearing the forms data but not it's state from an angular perspective.</p>
  
  <p>Any ideas on what I'm missing?</p>