I'm currently trying to create a directive that has two transcluded sections and have been unsuccessful so far. Now I discovered that the tab
directive of Angular UI Bootstrap does exactly that! Unfortunately, the angular trickery that they pull off in their source code is apparently too advanced for my understanding.
In the examples, they have the following code:
<tabset>
<tab select="alertMe()">
<tab-heading>
<i class="glyphicon glyphicon-bell"></i> Alert!
</tab-heading>
I've got an HTML heading, and a select callback. Pretty cool!
</tab>
</tabset>
This is exactly what I need. Can someone explain to me the steps that I need to take, so that the <tab-heading>
content is transcluded in one spot, and the other stuff in another?
Things I don't understand in the sources:
- There is no directive
tabHeading
only atabHeadingTransclude
. How is the<tab-heading>
element found, then? I also don't see a query for such elements anywhere. - I also don't understand the two transclude-directives
tabContentTransclude
andtabHeadingTransclude
.