This repository was archived by the owner on Apr 12, 2024. It is now read-only.
File tree 2 files changed +33
-0
lines changed
2 files changed +33
-0
lines changed Original file line number Diff line number Diff line change @@ -847,6 +847,10 @@ function $CompileProvider($provide, $$sanitizeUriProvider) {
847
847
? JQLitePrototype . clone . call ( $compileNodes ) // IMPORTANT!!!
848
848
: $compileNodes ;
849
849
850
+ if ( $linkNode . length === 0 && parentBoundTranscludeFn ) {
851
+ $linkNode = parentBoundTranscludeFn ( scope ) ;
852
+ }
853
+
850
854
forEach ( transcludeControllers , function ( instance , name ) {
851
855
$linkNode . data ( '$' + name + 'Controller' , instance ) ;
852
856
} ) ;
Original file line number Diff line number Diff line change @@ -4097,6 +4097,35 @@ describe('$compile', function() {
4097
4097
} ) ;
4098
4098
4099
4099
4100
+ describe ( 'collocated nested transcludes' , function ( ) {
4101
+
4102
+ beforeEach ( module ( function ( $compileProvider ) {
4103
+
4104
+ $compileProvider . directive ( 'inner' , valueFn ( {
4105
+ transclude : true ,
4106
+ template : '<div ng-transclude></div>'
4107
+ } ) ) ;
4108
+
4109
+ $compileProvider . directive ( 'outer' , valueFn ( {
4110
+ transclude : true ,
4111
+ template : '<a href="#"><div inner ng-transclude></div></a>'
4112
+ } ) ) ;
4113
+
4114
+ } ) ) ;
4115
+
4116
+
4117
+ // Issue #8914
4118
+ it ( 'should render nested transclusion at the root of a template' , inject ( function ( $compile , $rootScope ) {
4119
+
4120
+ element = $compile ( '<div><div outer>transcluded content</div></div>' ) ( $rootScope ) ;
4121
+ $rootScope . $digest ( ) ;
4122
+ expect ( element . text ( ) ) . toEqual ( 'transcluded content' ) ;
4123
+
4124
+ } ) ) ;
4125
+
4126
+ } ) ;
4127
+
4128
+
4100
4129
describe ( 'nested transcludes' , function ( ) {
4101
4130
4102
4131
beforeEach ( module ( function ( $compileProvider ) {
You can’t perform that action at this time.
0 commit comments