Recently, I began delving into AngularJS and attempted to create a custom table directive with multiple slots for transclusion. However, I encountered an issue where the scope was not being passed to the transclude. Although there are various solutions available on StackOverflow, none of them seem to work in my specific case where an ng-repeat is not present for the top element in the directive template. I am struggling to adapt these solutions to fit my requirements.
Here is a simplified version of the directive:
<span>
<div>Some pagination</div>
<div style="display: inline"><input type="text" placeholder="Search"/></div>
<div style="display: inline">Some filters</div>
<table>
<tbody>
<tr ng-repeat="line in lines" ng-transclude="row">
</tr>
</tbody>
</table>
<div>Some pagination again</div>
</span>
Usage of the directive:
<my-table>
<row>
<td>{{line.col1}}</td>
<td>{{line.col2}}</td>
</row>
</my-table>
View the full example and script on Plunkr: https://plnkr.co/edit/rg43ZdPMGHLBJCTLOoLC
Any guidance would be greatly appreciated.