File tree 2 files changed +35
-0
lines changed
2 files changed +35
-0
lines changed Original file line number Diff line number Diff line change @@ -997,6 +997,10 @@ function $CompileProvider($provide, $$sanitizeUriProvider) {
997
997
? JQLitePrototype . clone . call ( namespaceAdaptedCompileNodes ) // IMPORTANT!!!
998
998
: namespaceAdaptedCompileNodes ;
999
999
1000
+ if ( $linkNode . length === 0 && parentBoundTranscludeFn ) {
1001
+ $linkNode = parentBoundTranscludeFn ( scope ) ;
1002
+ }
1003
+
1000
1004
if ( transcludeControllers ) {
1001
1005
for ( var controllerName in transcludeControllers ) {
1002
1006
$linkNode . data ( '$' + controllerName + 'Controller' , transcludeControllers [ controllerName ] . instance ) ;
Original file line number Diff line number Diff line change @@ -4927,6 +4927,37 @@ describe('$compile', function() {
4927
4927
} ) ;
4928
4928
4929
4929
4930
+ describe ( 'collocated nested transcludes' , function ( ) {
4931
+
4932
+ beforeEach ( module ( function ( $compileProvider ) {
4933
+
4934
+ $compileProvider . directive ( 'inner' , valueFn ( {
4935
+ restrict : 'E' ,
4936
+ transclude : true ,
4937
+ template : '<u ng-transclude></u>'
4938
+ } ) ) ;
4939
+
4940
+ $compileProvider . directive ( 'outer' , valueFn ( {
4941
+ restrict : 'E' ,
4942
+ transclude : true ,
4943
+ template : '<a href="#"><inner ng-transclude></inner></a>'
4944
+ } ) ) ;
4945
+
4946
+ } ) ) ;
4947
+
4948
+
4949
+ // Issue #8914
4950
+ it ( 'should render nested transclusion at the root of a template' , inject ( function ( $compile , $rootScope ) {
4951
+
4952
+ element = $compile ( '<div><outer>transcluded content</outer></div>' ) ( $rootScope ) ;
4953
+ $rootScope . $digest ( ) ;
4954
+ expect ( element . text ( ) ) . toEqual ( 'transcluded content' ) ;
4955
+
4956
+ } ) ) ;
4957
+
4958
+ } ) ;
4959
+
4960
+
4930
4961
describe ( 'nested transcludes' , function ( ) {
4931
4962
4932
4963
beforeEach ( module ( function ( $compileProvider ) {
You can’t perform that action at this time.
0 commit comments