title: How to trigger a method when Angular is done adding scope updates to the DOM?
body: <p>I am looking for a way to execute code when after I add changes to a $scope variable, in this case $scope.results. I need to do this in order to call some legacy code that requires the items to be in the DOM before it can execute.</p>
  
  <p>My real code is triggering an AJAX call, and updating a scope variable in order to update the ui. So I currently my code is executing immediately after I push to the scope, but the legacy code is failing because the dom elements are not available yet.</p>
  
  <p>I could add an ugly delay with setTimeout(), but that doesn't guarantee that the DOM is truly ready.</p>
  
  <p><strong>My question is, is there any ways I can bind to a "rendered" like event?</strong></p>
  
  <pre><code>var myApp = angular.module('myApp', []);
  
  myApp.controller("myController", ['$scope', function($scope){
      var resultsToLoad = [{id: 1, name: "one"},{id: 2, name: "two"},{id: 3, name: "three"}];
      $scope.results = [];
  
      $scope.loadResults = function(){
          for(var i=0; i &lt; resultsToLoad.length; i++){
              $scope.results.push(resultsToLoad[i]);
          }
      }
  
      function doneAddingToDom(){
          // do something awesome like trigger a service call to log
      }
  }]);
  angular.bootstrap(document, ['myApp']);
  </code></pre>
  
  <p>Link to simulated code: <a href="http://jsfiddle.net/acolchado/BhApF/5/">http://jsfiddle.net/acolchado/BhApF/5/</a></p>
  
  <p>Thanks in Advance!</p>