Closed AlexCppns closed 10 years ago
Update: I think the problem is that it doesnt work in a ng-repeat.
Update2: Ok so the problem is that I use other directives in the transclusion, eg:
<a ng-multi-transclude="acfi-view-more" data-ng-if="searchBoxData.noResultDisplay == true" class="no-results" ></a>
won't work...
Update 3: Replacing ng-if by ng-show fixed it. Still unsure how to use transclusion inside a ng-repeat.
Hey Alex, apologies for the delayed response I was without connectivity for some time. I'll look into it, but I'm guessing that using both ng-multi-transclude
and ng-if
won't work due to the requirement that transclusion be used only once on an element. There's an internal method for allowing multiple different transclusions on a single element that Angular uses to allow ng-if
to be used with ng-repeat
; I'll see if I can get that to work.
As for using transclusion inside an ng-repeat
, you should simply be able to move the transcluding directive onto an element within the repeat:
<ul>
<li ng-repeat="thing in things">
<a ng-some-transluding-directive>...</a>
</li>
</ul>
Not great, as you end up with 1 wrapper element per transcluding directive, but it works. Perhaps I'm misunderstanding the issue you are facing though?
@zachsnow I solved it that way (see my comment on the answer):
I noticed that your library breaks that method by the way. I cannot use both at once. I used to have a plunkr about it somewhere... I lost it I think.
I guess I don't understand what you're trying to accomplish, but I'm glad you sorted something out. Cheers.
@zachsnow This is exactly what I was trying to do:
If there is a way to make it work with ng-multi-transclude. I ll be glad to hear it :).
By the way the error I have shown in my first post is a real bug.
Ah, ok. So you would like to place your "block to be filled" within an ng-repeat
, so that it is filled multiple times, and each time it is filled it is rendered relative to the context in which it is found.
That's not how I initially thought of ng-multi-transclude
being used, but it would be pretty awesome. I'll have a look.
Re: real bug, got it and a fix will be pushed tonight, should have been more clear; my apologies!
Closing this, relevant details for the transclusion issue have been added to #8.
at link (.../assets/angular_js/fancyinput_library/multi-transclude.js?body=1:51:41)
It seems to crash when trying to display the error:
I am not sure what that error means even...
</noob>