title: AngularJS : check if a model value has changed
body: <p>IS there a way to check a dirty flag on the model itself, independent of the view?</p>
  
  <p>I need the angular controller to know what properties have been changed, in order to only save changed variables to server. </p>
  
  <p>I have implemented logic regarding if my entire form is dirty or pristine, but that is not specific enough</p>
  
  <p>I could just slap a name and ng-form attribute on every input, to make it recognizable as a form in the controller, but then I end up with a controller that is strongly coupled with the view. </p>
  
  <p>Another not-so appealing approach is to store the initial values that every input is bound to in a separate object, then compare the current values with the initial values to know if they have changed. </p>
  
  <p>I checked <a href="https://stackoverflow.com/questions/26702124/monitor-specific-fields-for-pristine-dirty-form-state">Monitor specific fields for pristine/dirty form state</a> and <a href="https://stackoverflow.com/questions/26620660/angularjs-pristine-for-ng-check-checked-inputs">AngularJS : $pristine for ng-check checked inputs</a></p>