title: How do I reset a form in angularjs?
body: <p>See Fiddle: <a href="http://jsfiddle.net/hejado/7bqjqc2w/" rel="nofollow">http://jsfiddle.net/hejado/7bqjqc2w/</a></p>
  
  <p>I'm trying to form.reset() my form using angular.</p>
  
  <p>HTML:</p>
  
  <pre><code>&lt;div ng-controller="formCtrl"&gt;
  &lt;form name="resetme" id="resetme"&gt;
      &lt;input ng-model="text" type="text" /&gt;
      &lt;input file-model="file" type="file" /&gt;
      &lt;button type="button" ng-click="resetForm()"&gt;reset&lt;/button&gt;
  &lt;/form&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>JS:</p>
  
  <pre><code>.controller('formCtrl', function($scope) {
      $scope.resetForm = function() {
      //$scope.resetme.reset();
      document.getElementById('resetme').reset();
      };
  });
  </code></pre>
  
  <p><strong>Please note:</strong> I'm using this kind of form to ajax-upload a file. The page is not refreshing and I don't want to use any reset-buttons. (I'm using one in the fiddle for simplicity.) I want to call the reset-function after the fileupload is finished (via http success).</p>
  
  <p>I'm using</p>
  
  <pre><code>&lt;input type="file" /&gt;
  </code></pre>
  
  <p>so I can't reassign empty values to all my inputs, because file inputs are readonly.</p>
  
  <p>Calling the reset() function on the DOM element works, but I was told talking to the DOM in angular would be evil, so...</p>
  
  <p>I'd like to know, how this would be done the <strong>angular way</strong>. I tried naming the form and referencing it via $scope.<em>formname</em> but I'm not able to call Web API functions... (commented line)</p>
  
  <p>How can I achieve this?</p>
  
  <p><strong>UPDATE</strong>
  After reading some of the answers, I should make clear, that I am using ngModel and a custom directive <a href="https://uncorkedstudios.com/blog/multipartformdata-file-upload-with-angularjs" rel="nofollow">fileModel</a> to get a hold of the file-object.</p>
  
  <p>Some of the solutions worked in resetting the value of the input field, but the model is not cleared (neither file, nor text). Custom directives are the answer to that, but this kinda exceeds the scope of this question.</p>