title: unable to reset form data from ng-models in angularjs even by clearing DOM
body: <p>I have a dashboard that contains a list of members <strong>members</strong>. On login a user is taken to the dashboard.  On clicking anyone of the records and they are brought to a form (abPro.html.) where they can edit the details. </p>
  
  <p></p>
  
  <p></p>
  
  <pre><code>&lt;input type="text" class="form-control resetFormData ANo" maxlength="25" ng-model="ANo"&gt;
  
  &lt;button ng-click = "linkDash()"&gt;Go to Dashboard&lt;/button&gt;
  
  &lt;button ng-click = "saveCoLea(EmailId,ANo)"&gt;Save As Draft&lt;/button&gt;
  </code></pre>
  
  <p></p>
  
  <p>The "Go To Dashboard" button takes the user back to the dashboard. This allows users to toggle between the dashboard and the form so that they can view the details of members make changes and save the information. Whenever the user clicks the the <strong>Go To Dashboard</strong> we trigger the linkDash() function in main.js with controller AppController that resets the Form. (Included only two form fields to keep the code short)</p>
  
  <pre><code>$scope.linkDash = function(){    
       $scope.EmailId = undefined;    
       $scope.ANo = undefined;    
       $(".resetFormData").val('');    
  }
  </code></pre>
  
  <p>When the "Save As Draft"  button is clicked it triggers the function saveCoLead() function in abPro.js with controller abProController</p>
  
  <pre><code>$scope.saveCorporateLead = function(EmailId,AccountNo){
        alert(Emailid +’and’+ AccountNo);
  }
  </code></pre>
  
  <p>When the user saves the from the data gets saved. However after saving if the user goes back to the dashboard by clicking <strong>Go To Dashboard</strong> button picks up another members data makes changes to the form and lets say leaves the <strong>email id</strong> blank and then saves the data we find that the email id of the previous member is inserted into the database. Ideally the email id should have been blank or null because the moment the user clicks on th dashboard the form fields are reset. Its only after this does the user pick up the details of another member which gets loaded into the form.</p>
  
  <p>Wondering if anyone has a clue why this is happening and how could the form fields be reset.</p>