I'm trying to get the ng-repeat directive that is placed into another directive which transcludes its content. The point here is to retrieve the transcluded content before it gets compiled, e.g.:
<tr ng-repeat="item in items">
<td>{{item}}</td>
</tr>
Here's a simple example of what I am trying to achieve (and a plnkr):
app.directive('pageable', function() {
return {
restrict:'E',
template:'<div ng-transclude></div>',
transclude: true,
priority: 1001,
scope: true,
compile: function(element, attrs) {
console.log(element.html());
console.log(element);
}
};
});
Actually, I get either already compiled ng-repeat directive or simply comment like:
<!-- ng-repeat: item in items -->
Is there a way to get the transcluded content before it gets compiled?