AngularJS - Append element to each ng-repeat iteration inside a directive
问题 I'm using a ng-repeat inside a <tr> element together with a directive. Html: <tbody> <tr ng-repeat="row in rows" create-table> <td nowrap ng-repeat="value in row | reduceString>{{value}}</td> </tr> </tbody> Directive: app.directive('createTable', function () { return { link: function (scope, element, attrs) { var contentTr = scope.$eval('"<tr ng-show="false"><td>test</td></tr>"'); $(contentTr).insertBefore(element); } } } ); Although I can append a new <tr> element to each iteration, I'm not