title: angularjs save changes after digest has finished
body: <p>I think this might be quite common use-case with any angular app. I am simply watching some objects on my scope that are changed as part of several digest cycles. After digesting them (changing their values via databinding) has finished, I want to save them to databse. </p>
  
  <p>A. Now, with the current solutions I see following problems:</p>
  
  <ol>
  <li><p>running save in $timeout() - how to assure that save is called only
  once</p></li>
  <li><p>running a custom function in $scope.$evalAsync - how to find out what has been chaged</p></li>
  </ol>
  
  <p>There are of course solutions to both of these prolblems, but non of those I know seem ehough elegant to me. </p>
  
  <p>The question is: <strong>What is the most elegant solution to the problem?</strong></p>
  
  <p>B. In particular, what are the best practices to</p>
  
  <ol>
  <li><p>make sure that save gets called only once in a digest cycle</p></li>
  <li><p>find out that object is <em>dirty</em> after last digest</p></li>
  </ol>