I seem to be missing something here, as I can't seem to get the desired outcome with my code: http://plnkr.co/edit/Qe2IzMMMR5BJZJpwkx9e?p=preview
My goal is to create a directive that can be applied to a top-level <nav>
element, and then manipulate the inner DOM elements in its link function (like adding CSS classes to <li>
elements, for example).
However, it seems that the link function only receives the original directive template (
<nav><ul><ng-transclude/></ul></nav
), and not the transcluded or expanded DOM elements.
If this behavior is intentional, what would be the best approach to achieve this? It doesn't make much sense to have a transcluding "root" directive without access to the transcluded DOM tree....