@@ -4185,6 +4185,73 @@ describe('$compile', function() {
4185
4185
} ) ;
4186
4186
4187
4187
4188
+ describe ( 'nested isolated scope transcludes' , function ( ) {
4189
+ beforeEach ( module ( function ( $compileProvider ) {
4190
+
4191
+ $compileProvider . directive ( 'trans' , valueFn ( {
4192
+ restrict : 'E' ,
4193
+ template : '<div ng-transclude></div>' ,
4194
+ transclude : true
4195
+ } ) ) ;
4196
+
4197
+ $compileProvider . directive ( 'transAsync' , valueFn ( {
4198
+ restrict : 'E' ,
4199
+ templateUrl : 'transAsync' ,
4200
+ transclude : true
4201
+ } ) ) ;
4202
+
4203
+ $compileProvider . directive ( 'iso' , valueFn ( {
4204
+ restrict : 'E' ,
4205
+ transclude : true ,
4206
+ template : '<trans><span ng-transclude></span></trans>' ,
4207
+ scope : { }
4208
+ } ) ) ;
4209
+ $compileProvider . directive ( 'isoAsync1' , valueFn ( {
4210
+ restrict : 'E' ,
4211
+ transclude : true ,
4212
+ template : '<trans-async><span ng-transclude></span></trans-async>' ,
4213
+ scope : { }
4214
+ } ) ) ;
4215
+ $compileProvider . directive ( 'isoAsync2' , valueFn ( {
4216
+ restrict : 'E' ,
4217
+ transclude : true ,
4218
+ templateUrl : 'isoAsync' ,
4219
+ scope : { }
4220
+ } ) ) ;
4221
+ } ) ) ;
4222
+
4223
+ beforeEach ( inject ( function ( $templateCache ) {
4224
+ $templateCache . put ( 'transAsync' , '<div ng-transclude></div>' ) ;
4225
+ $templateCache . put ( 'isoAsync' , '<trans-async><span ng-transclude></span></trans-async>' ) ;
4226
+ } ) ) ;
4227
+
4228
+
4229
+ it ( 'should pass the outer scope to the transclude on the isolated template sync-sync' , inject ( function ( $compile , $rootScope ) {
4230
+
4231
+ $rootScope . val = 'transcluded content' ;
4232
+ element = $compile ( '<iso><span ng-bind="val"></span></iso>' ) ( $rootScope ) ;
4233
+ $rootScope . $digest ( ) ;
4234
+ expect ( element . text ( ) ) . toEqual ( 'transcluded content' ) ;
4235
+ } ) ) ;
4236
+
4237
+ it ( 'should pass the outer scope to the transclude on the isolated template async-sync' , inject ( function ( $compile , $rootScope ) {
4238
+
4239
+ $rootScope . val = 'transcluded content' ;
4240
+ element = $compile ( '<iso-async1><span ng-bind="val"></span></iso-async1>' ) ( $rootScope ) ;
4241
+ $rootScope . $digest ( ) ;
4242
+ expect ( element . text ( ) ) . toEqual ( 'transcluded content' ) ;
4243
+ } ) ) ;
4244
+
4245
+ it ( 'should pass the outer scope to the transclude on the isolated template async-async' , inject ( function ( $compile , $rootScope ) {
4246
+
4247
+ $rootScope . val = 'transcluded content' ;
4248
+ element = $compile ( '<iso-async2><span ng-bind="val"></span></iso-async2>' ) ( $rootScope ) ;
4249
+ $rootScope . $digest ( ) ;
4250
+ expect ( element . text ( ) ) . toEqual ( 'transcluded content' ) ;
4251
+ } ) ) ;
4252
+
4253
+ } ) ;
4254
+
4188
4255
describe ( 'multiple siblings receiving transclusion' , function ( ) {
4189
4256
4190
4257
it ( "should only receive transclude from parent" , function ( ) {
0 commit comments