File tree Expand file tree Collapse file tree 2 files changed +35
-0
lines changed
Expand file tree Collapse file tree 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) {
997997 ? JQLitePrototype . clone . call ( namespaceAdaptedCompileNodes ) // IMPORTANT!!!
998998 : namespaceAdaptedCompileNodes ;
999999
1000+ if ( $linkNode . length === 0 && parentBoundTranscludeFn ) {
1001+ $linkNode = parentBoundTranscludeFn ( scope ) ;
1002+ }
1003+
10001004 if ( transcludeControllers ) {
10011005 for ( var controllerName in transcludeControllers ) {
10021006 $linkNode . data ( '$' + controllerName + 'Controller' , transcludeControllers [ controllerName ] . instance ) ;
Original file line number Diff line number Diff line change @@ -4927,6 +4927,37 @@ describe('$compile', function() {
49274927 } ) ;
49284928
49294929
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+
49304961 describe ( 'nested transcludes' , function ( ) {
49314962
49324963 beforeEach ( module ( function ( $compileProvider ) {
You can’t perform that action at this time.
0 commit comments