Add More form does not get reset after submit in angularjs
<p>I am using AngualrJS with Java from webjar library. I have one form which having 3 fields - name, desc and quantity. It is using as add more, add more items. Below is similar code I am using.</p>

<p><div class="snippet" data-lang="js" data-hide="false" data-console="true">
<div class="snippet-code">
<pre class="snippet-code-js lang-js prettyprint-override"><code> angular.module("ngApp").controller("taskController", function($scope) {
   $scope.submitted = false;
   $scope.item = {};
   $scope.items = [];

   $scope.submitTask = function(item) {
     $scope.items.push(item);
     $scope.submitted = false;
     $scope.itemForm.$setPristine();
     $scope.itemForm.$setUntouched();
   };
});</code></pre>
<pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;div ng-controller="taskController"&gt;
  &lt;form name="itemForm" ng-submit="submitted &amp;&amp; submitTask(item)" novalidate&gt;
    &lt;div&gt;
      &lt;input type="text" name="name" ng-model="item.name" required/&gt;
    &lt;/div&gt;
    &lt;div&gt;
      &lt;input type="text" name="description" ng-model="item.description" required/&gt;
    &lt;/div&gt;
    &lt;div&gt;
      &lt;input type="text" name="quantity" ng-model="item.quantity" required/&gt;
    &lt;/div&gt;
    &lt;div&gt;
      &lt;button type="submit" ng-click="submitted=true"&gt;Submit&lt;/button&gt;
    &lt;/div&gt;
  &lt;/form&gt;
&lt;/div&gt;</code></pre>
</div>
</div>
</p>

<p>Here <code>$scope.submitted</code> is set false in <code>$scope.submitTask</code>. But in view it shows are true. Even <code>$scope.itemForm.$setPristine()</code> and <code>$scope.itemForm.$setUntouched()</code> gives error as undefined. </p>

<p>Please let me know where I am going wrong?</p>