When working on my application, I utilize this HTML snippet for an ng-repeat
:
<div class="gridBody">
<div ng-class="{clicked: row.current == true}"
ng-click="home.rowClicked($index)"
ng-dblclick="ctrl.rowDoubleClicked(row)"
ng-repeat="row in home.grid.view = (home.grid.data | orderBy:ctrl.examOrderBy[ctrl.configService.admin.examOrderBy].key:ctrl.configService.admin.examSortDirection) track by row.examId">
While I am familiar with creating template directives, I am unsure if it's possible to create a directive that calls another directive like how ng-repeat
is called here. How would I go about creating a directive that allows me to use the code block in this manner:
<div grid-body
order="ctrl.examOrderBy[ctrl.configService.admin.examOrderBy].key"
direction="ctrl.configService.admin.examSortDirection)"
track="examId">
Essentially, I want a directive that combines the two <div>
's above into one. It seems like using transclude might be necessary, but I am unsure of how to implement it in this context as I couldn't find any relevant examples.