title: AngularJS: how to know when the $compile has finished?
body: <blockquote>
    <p><a href="http://plnkr.co/edit/GRVZl35D1cuWz1kzXZfF?p=preview" rel="nofollow">http://plnkr.co/edit/GRVZl35D1cuWz1kzXZfF?p=preview</a></p>
  </blockquote>
  
  <p>In the custom fancybox (aka lightbox, a dialog) I show contents with interpolated values. </p>
  
  <p>in the service, in the "open" fancybox method, i do</p>
  
  <pre><code> open: function(html, $scope) {
          var el = angular.element(html);
          $compile(el)($scope); // how to know when the $compile is over?
          $.fancybox.open(el); // the uncompiled is shown before the compiled
        }
  </code></pre>
  
  <p>The problem is that the content in the dialog is loaded before the end of the $compile, so after less than a second i got a refresh of the dialog content with the values. </p>
  
  <p><strong>The plunkr works, but i want to avoid that the "el" is shown before it gets totally compiled: i want to show it only after the $compile has finished his job</strong></p>
  
  <p>Is there a way to know when the $compile it's over so i'll show the content on fancybox only after that?</p>