zachsnow / ng-multi-transclude

ng-multi-transclude
MIT License
79 stars 19 forks source link

Duplicate ng-multi-transclude #35

Open JoshWillik opened 9 years ago

JoshWillik commented 9 years ago

When I have a template that looks like this

<div class="hidden-menu-wrapper" ng-multi-transclude-controller>
  <div class="icon" ng-multi-transclude="icon"></div>
  <div class="menu">
    <div class="icon" ng-multi-transclude="icon"></div>
    <div class="content" ng-multi-transclude="content"></div>
  </div>
</div>

Only the last ng-multi-include="icon" is filled in the output. Is there a way to fill both with the same information?

JoshWillik commented 9 years ago

I've tried changing this line from element.append(el); to element.append(el.copy());, but this seems to stop angular interpolation from working.

zachsnow commented 9 years ago

The current approach that ng-multi-transclude takes to linking content does not afford a way to relink individual blocks, nor does it correctly relink when a block is removed and then re-added to the DOM (for instance due to ng-if). I have a branch that I'm working on to address these issues which would let this work as well I imagine.

JoshWillik commented 9 years ago

Awesome, thanks. Feel free to close this if you like :)