@@ -504,6 +504,14 @@ describe('$compile', function() {
504
504
expect ( element ) . toBe ( attr . $$element ) ;
505
505
}
506
506
} ) ) ;
507
+ directive ( 'replaceWithInterpolatedStyle' , valueFn ( {
508
+ replace : true ,
509
+ template : '<div style="width:{{1+1}}px">Replace with interpolated style!</div>' ,
510
+ compile : function ( element , attr ) {
511
+ attr . $set ( 'compiled' , 'COMPILED' ) ;
512
+ expect ( element ) . toBe ( attr . $$element ) ;
513
+ }
514
+ } ) ) ;
507
515
} ) ) ;
508
516
509
517
@@ -581,13 +589,22 @@ describe('$compile', function() {
581
589
} ) ) ;
582
590
583
591
584
- it ( 'should handle interpolated css from replacing directive' , inject (
592
+ it ( 'should handle interpolated css class from replacing directive' , inject (
585
593
function ( $compile , $rootScope ) {
586
594
element = $compile ( '<div replace-with-interpolated-class></div>' ) ( $rootScope ) ;
587
595
$rootScope . $digest ( ) ;
588
596
expect ( element ) . toHaveClass ( 'class_2' ) ;
589
597
} ) ) ;
590
598
599
+ if ( ! msie || msie > 10 ) {
600
+ // style interpolation not working on IE<11.
601
+ it ( 'should handle interpolated css style from replacing directive' , inject (
602
+ function ( $compile , $rootScope ) {
603
+ element = $compile ( '<div replace-with-interpolated-style></div>' ) ( $rootScope ) ;
604
+ $rootScope . $digest ( ) ;
605
+ expect ( element . css ( 'width' ) ) . toBe ( '2px' ) ;
606
+ } ) ) ;
607
+ }
591
608
592
609
it ( 'should merge interpolated css class' , inject ( function ( $compile , $rootScope ) {
593
610
element = $compile ( '<div class="one {{cls}} three" replace></div>' ) ( $rootScope ) ;
0 commit comments