I have a general <item> directive and a <listing> directive with filters and pagination tools for enumerating <item> :

Example : https://plnkr.co/edit/r6byzhFX5m674ONhH1JS?p=preview
The <listing> template looks something like this:
<div ng-repeat="item in items"> <item date="item"> <ng-transclude ng-transclude-slot="itemContent"></ng-transclude> </item> </div>
The <item> directive uses the new transition between multiple Angular 1.5 slots to easily customize the footer and header:
<item data="itemData"> <header>My header</header> <footer>My custom footer</footer> </item>
My problem occurs when I try to customize these elements when using <listing> . If I use something like this:
<listing items="myItems"> <item-content> <header>{{ item.name }}</header> <footer>My custom footer for {{ item.name }}</footer> </item-content> </listing>
This does not work because <item-content> inserted into <item> , but <header> and <footer> not translated to the appropriate places, and they cannot read the item scope variable. Is there any way to achieve this?
angularjs angularjs-ng-transclude
Javier marΓn
source share