title: How to wait till the end of $compile in angularJS
body: <p>I'm loading a template and then compiling it against my scope using <code>$compile</code> service.</p>
  
  <pre><code>var template = "&lt;div&gt; .. {{someCompilingStuff}} ..&lt;/div&gt;";
  var compiled = $compile(template)(cellScope);
  </code></pre>
  
  <p>and then using it in a popover</p>
  
  <pre><code>cellElement.popover({
      html: true,
      placement: "bottom",
      trigger: "manual",
      content: compiled
  });
  </code></pre>
  
  <p>My template is quite complex and may take some time to compile.</p>
  
  <p>How can I make sure that angular has finished compiling the template before using it in the popover ?</p>
  
  <p><strong>Edit</strong>: I tried to force angular to <code>$apply()</code> before creating the popover, it does work but generate javascript errors which is not acceptable for me.</p>