@@ -1938,6 +1938,21 @@ describe('$compile', function() {
1938
1938
compile ( '<div><span bad-declaration>' ) ;
1939
1939
} ) . toThrow ( 'Invalid isolate scope definition for directive badDeclaration: xxx' ) ;
1940
1940
} ) ) ;
1941
+
1942
+ it ( 'should expose a $$isolateBindings property onto the scope' , inject ( function ( ) {
1943
+ compile ( '<div><span my-component>' ) ;
1944
+
1945
+ expect ( typeof componentScope . $$isolateBindings ) . toBe ( 'object' ) ;
1946
+
1947
+ expect ( componentScope . $$isolateBindings . attr ) . toBe ( '@attr' ) ;
1948
+ expect ( componentScope . $$isolateBindings . attrAlias ) . toBe ( '@attr' ) ;
1949
+ expect ( componentScope . $$isolateBindings . ref ) . toBe ( '=ref' ) ;
1950
+ expect ( componentScope . $$isolateBindings . refAlias ) . toBe ( '=ref' ) ;
1951
+ expect ( componentScope . $$isolateBindings . reference ) . toBe ( '=reference' ) ;
1952
+ expect ( componentScope . $$isolateBindings . expr ) . toBe ( '&expr' ) ;
1953
+ expect ( componentScope . $$isolateBindings . exprAlias ) . toBe ( '&expr' ) ;
1954
+
1955
+ } ) ) ;
1941
1956
} ) ;
1942
1957
1943
1958
@@ -2264,5 +2279,28 @@ describe('$compile', function() {
2264
2279
2265
2280
expect ( element . text ( ) ) . toBe ( '-->|x|' ) ;
2266
2281
} ) ) ;
2282
+
2283
+
2284
+ it ( 'should add a $$transcluded property onto the transcluded scope' , function ( ) {
2285
+ module ( function ( ) {
2286
+ directive ( 'trans' , function ( ) {
2287
+ return {
2288
+ transclude : true ,
2289
+ replace : true ,
2290
+ scope : true ,
2291
+ template : '<div><span>I:{{$$transcluded}}</span><div ng-transclude></div></div>'
2292
+ } ;
2293
+ } ) ;
2294
+ } ) ;
2295
+ inject ( function ( log , $rootScope , $compile ) {
2296
+ element = $compile ( '<div><div trans>T:{{$$transcluded}}</div></div>' )
2297
+ ( $rootScope ) ;
2298
+ $rootScope . $apply ( ) ;
2299
+ expect ( jqLite ( element . find ( 'span' ) [ 0 ] ) . text ( ) ) . toEqual ( 'I:' ) ;
2300
+ expect ( jqLite ( element . find ( 'span' ) [ 1 ] ) . text ( ) ) . toEqual ( 'T:true' ) ;
2301
+ } ) ;
2302
+ } ) ;
2303
+
2304
+
2267
2305
} ) ;
2268
2306
} ) ;
0 commit comments