title: angularjs - set certain inputs with data to $pristine or untouched correctly
body: <p>After researching i am still stuck on my predicament. I am using the latest version of foundation for apps with angular 'pre-embedded'.</p>
  
  <p>I have a form which is used for both adding and editing data - lets say its for a job and it tracks employees days on the job. on load of the view the form is completely empty and contains two sections - the job details and the employees details.</p>
  
  <p>first the user would have to enter and save the details in the job section (in order to create the id for the job so the employees can be linked to it) for the employees section to be activated. This works fine and is enabled by the job id being set to > 0 (-1 being default on load); </p>
  
  <p>This all works fine so far, but i have a function in my controller to allow loading in an existing job record. when the user blurs on one of three fields the controller checks the data object for jobs matching these unique fields and loads (angular.copy) in the data in the scopes 'job' model. When this is loaded all form inputs are set and marked as dirty.</p>
  
  <p>obviously my required behavior is that if the job details are loaded in by the system the form is not marked as dirty so as to allow me to know if the job details have been edited at any point after. the same is required of a new job that has been saved and given an id. </p>
  
  <p>as i understand it the setPristine() function actually resets the form and model, similar to <code>form[0].reset()</code> but I may be wrong. I also suspect untouched may be a way to go?</p>
  
  <p>also i should mention that the  contains all sections to this view including the add employee inputs in the employee section.</p>
  
  <p>I understand I can simply remove the ng-dirty class manually but have read this then does not update the angular way and will not identify further edits.</p>
  
  <p>Is there a way i can functionally remove the ng-dirty from all child inputs of an element and not all in the form and without removing the loaded data too?</p>
  
  <p>note: all inputs by default are linked (via <code>ng-model</code>) to their relevant models and data is loaded in the controller to the model.</p>