title: is angular's compile function async?
body: <p>I have a service in which I call <code>$compile</code> to compile my template. Function in JS are getting executed one after another. However, in order get my final HTML I have to put <code>html()</code> in timeout callback. Otherwise, I get my template with <code>{{ placeholders }}</code> only. The questions is why I need to use timeout here? Here is my code:</p>
  
  <pre><code>var newScope = $rootScope.$new(true);
  angular.extend(newScope, data);
  var compiled = $compile(template);
  var linked = compiled(newScope);
  
  $timeout(function () {
    def.resolve(linked.html());
  });
  </code></pre>