@@ -1078,6 +1078,44 @@ describe('$uibModal', function () {
1078
1078
} ) ;
1079
1079
} ) ;
1080
1080
1081
+ describe ( 'modal window' , function ( ) {
1082
+ it ( 'should not use transclusion scope for modals content - issue 2110' , function ( ) {
1083
+ $rootScope . animate = false ;
1084
+ $compile ( '<div uib-modal-window animate="animate"><span ng-init="foo=true"></span></div>' ) ( $rootScope ) ;
1085
+ $rootScope . $digest ( ) ;
1086
+
1087
+ expect ( $rootScope . foo ) . toBeTruthy ( ) ;
1088
+ } ) ;
1089
+
1090
+ it ( 'should support custom CSS classes as string' , function ( ) {
1091
+ $rootScope . animate = false ;
1092
+ var windowEl = $compile ( '<div uib-modal-window animate="animate" window-class="test foo">content</div>' ) ( $rootScope ) ;
1093
+ $rootScope . $digest ( ) ;
1094
+
1095
+ expect ( windowEl ) . toHaveClass ( 'test' ) ;
1096
+ expect ( windowEl ) . toHaveClass ( 'foo' ) ;
1097
+ } ) ;
1098
+
1099
+ it ( 'should support window top class' , function ( ) {
1100
+ $rootScope . animate = false ;
1101
+ var windowEl = $compile ( '<div uib-modal-window animate="animate" window-top-class="test foo">content</div>' ) ( $rootScope ) ;
1102
+ $rootScope . $digest ( ) ;
1103
+
1104
+ expect ( windowEl ) . toHaveClass ( 'test' ) ;
1105
+ expect ( windowEl ) . toHaveClass ( 'foo' ) ;
1106
+ } ) ;
1107
+
1108
+ it ( 'should support custom template url' , inject ( function ( $templateCache ) {
1109
+ $templateCache . put ( 'window.html' , '<div class="mywindow" ng-transclude></div>' ) ;
1110
+
1111
+ var windowEl = $compile ( '<div uib-modal-window template-url="window.html" window-class="test">content</div>' ) ( $rootScope ) ;
1112
+ $rootScope . $digest ( ) ;
1113
+
1114
+ expect ( windowEl ) . toHaveClass ( 'mywindow' ) ;
1115
+ expect ( windowEl ) . toHaveClass ( 'test' ) ;
1116
+ } ) ) ;
1117
+ } ) ;
1118
+
1081
1119
describe ( 'multiple modals' , function ( ) {
1082
1120
it ( 'it should allow opening of multiple modals' , function ( ) {
1083
1121
var modal1 = open ( { template : '<div>Modal1</div>' } ) ;
0 commit comments