How to clear form in AngularJS when there is no form name
<p>I want to use the $setPristine() and $setUntouched() functions in Angular to clear form fields. However, they seem to only work with forms that have names. What if I have a form with no name and only a simple submit function? </p>

<p>I read the documentation here: <a href="https://docs.angularjs.org/api/ng/type/form.FormController" rel="nofollow">https://docs.angularjs.org/api/ng/type/form.FormController</a></p>

<p>This does not work:</p>

<pre><code>    $scope.submit = function() {

        // blah blah

        // Resets the form fields to blank
        // I could simply do
        // $scope.field1 = '';
        // $scope.field2 = '';
        // But I want it to look cleaner

        This.$setPristine();
        This.$setUntouched();

    };
</code></pre>