Get transclude slot from nested child in angularjs

123 Views Asked by At

I have a multi-transclude directive with two slots:

myModule.directive('myDirective', function () {
    return {
        restrict: 'E',
        templateUrl: 'myTemplate.html',
        transclude: {
            'slot1': 'slot1',
            'slot2': 'slot2',
        },
...

It works completely fine if I use it like this:

<my-directive>
  <slot1>Some content</slot1>
  <slot2>Some other content</slot2>
</my-directive>

But, I need to define <slot2> in another directive:

<my-directive>
  <slot1>
     some content
     <another-directive></another-directive>
  </slot1>
</my-directive>

another-directive.html:

<slot2>I want my-directive see this slot</slot2>

Any idea how to achieve this goal?

0

There are 0 best solutions below