title: updating DOM inside ng-repeat
body: <p>I have created a directive that uses template having <code>ng-repeat='row in rows'</code>. I am using a button to insert one row at a time with fields and using <code>link</code> function to update DOM inside <code>ng-repeat</code> with div like:</p>
  
  <pre><code>var div = '&lt;div&gt;' +
    '&lt;input type="text" ng-model="row.name"&gt;' +
  '&lt;/div&gt;';
  var e = $compile(div)(scope);
  jQuery('#myDiv').replaceWith(e);
  </code></pre>
  
  <p>The problem is I can't use the <code>row</code> object of <code>ng-repeat</code> due to which it doesn't update the <code>name</code>. Is there any way to compile with current <code>row</code> object of <code>rows</code>?</p>
  
  <p>I am actually using database to show data in <code>ng-repeat</code> and for certain fields I have to use <code>textarea</code> and for others have to use <code>text</code> box, which I don't think is possible inside template. So, I am using <code>link</code> function inside directive and update DOM.</p>