Using ng-transclude inside an ng-include pattern

When trying to use ng-transclude inside the ng-include template, it throws an error below,

Error: [ngTransclude:orphan] Illegal use of ngTransclude directive in the template! No parent directive that requires a transclusion found. Element: <ng-transclude>

I included transclude: truethe scope of the directive,

// directive1.html
<div>
    <div ng-include="template.html">
</div>

// template.html
<div>
  <ng-transclude></ng-transclude>
</div>
+4
source share

Source: https://habr.com/ru/post/1658162/


All Articles