@@ -1938,6 +1938,21 @@ describe('$compile', function() {
19381938 compile ( '<div><span bad-declaration>' ) ;
19391939 } ) . toThrow ( 'Invalid isolate scope definition for directive badDeclaration: xxx' ) ;
19401940 } ) ) ;
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+ } ) ) ;
19411956 } ) ;
19421957
19431958
@@ -2264,5 +2279,28 @@ describe('$compile', function() {
22642279
22652280 expect ( element . text ( ) ) . toBe ( '-->|x|' ) ;
22662281 } ) ) ;
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+
22672305 } ) ;
22682306} ) ;
0 commit comments