title: angularjs - inserting $compile-d html
body: <p><em>(Note that you don't need to know about datatables for this one..)</em></p>
  
  <p>I'm creating a directive to handle <a href="http://datatables.net/index">DataTables</a>.  What I'd like to do is have an actions column with two icons - edit and delete.  Those icons should response to an ng-click.</p>
  
  <p>Datatables allow you do this by providing a callback for a given column defintion (<a href="http://www.datatables.net/usage/columns#mRender">mRender</a>).  This callback returns an <strong>html string</strong> for that cell value, which is inserted into the DOM instead of the actual cell value.</p>
  
  <p>Checkout this <a href="http://embed.plnkr.co/oWa2tG2ocokcTSbYVqNG">plunker</a>.  The two important functions are highlighted:</p>
  
  <ul>
  <li><code>renderActionIcon</code> - my implementation of the callback mentioned above.  It generates the HTML string that I'd like in the cell.</li>
  <li><code>registerNewHtmlWithAngular</code> - function where I ostensibly let angular know about the ng-clicks that I need to register for that column.</li>
  </ul>
  
  <p>What should go in <code>registerNewHtmlWithAngular</code>?</p>
  
  <p>If $compile the html, angular adds the appropriate click event listeners and gives me back an element, but since the Datatables function expects HTML, those registered elements will not be added to the DOM.</p>
  
  <p>Any ideas?  Thanks folks!</p>