title: angular.element replaceWith not working
body: <p>I have an element to replace and the html text is in varaiable <code>h</code>
  The first call to this works perfectly. But the second call does not.</p>
  
  <pre><code>var newElement;
  var h="&lt;div&gt;a&lt;/div&gt;";
  newElement = angular.element(h);
  $compile(newElement[0])($scope);        
  angular.element($element[0]).replaceWith(newElement[0]);
  </code></pre>