@@ -112,7 +112,7 @@ describe('$mdCompiler service', function() {
112
112
var data = compile ( {
113
113
template : '<span>hello</span>'
114
114
} ) ;
115
- var scope = $rootScope . $new ( ) ;
115
+ var scope = $rootScope . $new ( false ) ;
116
116
data . link ( scope ) ;
117
117
expect ( data . element . scope ( ) ) . toBe ( scope ) ;
118
118
} ) ) ;
@@ -127,7 +127,7 @@ describe('$mdCompiler service', function() {
127
127
this . injectedOne = one ;
128
128
}
129
129
} ) ;
130
- var scope = $rootScope . $new ( ) ;
130
+ var scope = $rootScope . $new ( false ) ;
131
131
data . link ( scope ) ;
132
132
expect ( data . element . controller ( ) ) . toBeTruthy ( ) ;
133
133
expect ( data . element . controller ( ) . injectedOne ) . toBe ( 1 ) ;
@@ -143,7 +143,7 @@ describe('$mdCompiler service', function() {
143
143
}
144
144
} ) ;
145
145
146
- var scope = $rootScope . $new ( ) ;
146
+ var scope = $rootScope . $new ( false ) ;
147
147
data . link ( scope ) ;
148
148
149
149
expect ( ctrlElement ) . toBe ( data . element ) ;
@@ -155,7 +155,7 @@ describe('$mdCompiler service', function() {
155
155
controller : function Ctrl ( ) { } ,
156
156
controllerAs : 'myControllerAs'
157
157
} ) ;
158
- var scope = $rootScope . $new ( ) ;
158
+ var scope = $rootScope . $new ( false ) ;
159
159
data . link ( scope ) ;
160
160
expect ( scope . myControllerAs ) . toBe ( data . element . controller ( ) ) ;
161
161
} ) ) ;
@@ -164,12 +164,24 @@ describe('$mdCompiler service', function() {
164
164
165
165
} ) ;
166
166
167
- [
167
+ var bindingStatesToTest ;
168
+ if ( angular . version . major === 1 && angular . version . minor === 7 ) {
169
+ bindingStatesToTest = [
170
+ { respectPreAssignBindingsEnabled : true }
171
+ ] ;
172
+ } else if ( angular . version . major === 1 && angular . version . minor === 6 ) {
173
+ bindingStatesToTest = [
168
174
{ respectPreAssignBindingsEnabled : true } ,
169
175
{ respectPreAssignBindingsEnabled : false } ,
170
- // TODO change `equivalentTo` to `true` in Material 1.2.
171
176
{ respectPreAssignBindingsEnabled : '"default"' , equivalentTo : false }
172
- ] . forEach ( function ( options ) {
177
+ ] ;
178
+ } else if ( angular . version . major === 1 && angular . version . minor < 6 ) {
179
+ bindingStatesToTest = [
180
+ { respectPreAssignBindingsEnabled : false }
181
+ ] ;
182
+ }
183
+
184
+ bindingStatesToTest . forEach ( function ( options ) {
173
185
var realRespectPreAssignBindingsEnabled = options . respectPreAssignBindingsEnabled ;
174
186
var respectPreAssignBindingsEnabled = angular . isDefined ( options . equivalentTo ) ?
175
187
options . equivalentTo :
@@ -224,7 +236,7 @@ describe('$mdCompiler service', function() {
224
236
expect ( isInstantiated ) . toBe ( true ) ;
225
237
} ) ;
226
238
227
- // Bindings are not preassigned only if we respect the AngularJS config and they're
239
+ // TODO Bindings are now preassigned only if we respect the AngularJS config and they're
228
240
// disabled there. This logic will change in Material 1.2.0.
229
241
if ( respectPreAssignBindingsEnabled && ! preAssignBindingsEnabledInAngularJS ) {
230
242
it ( 'disabled should assign bindings after constructor' , function ( ) {
@@ -400,7 +412,7 @@ describe('$mdCompiler service', function() {
400
412
401
413
it ( 'should preserve a previous linked scope' , function ( ) {
402
414
403
- var scope = $rootScope . $new ( ) ;
415
+ var scope = $rootScope . $new ( false ) ;
404
416
405
417
var data = compile ( {
406
418
contentElement : $compile ( '<div>With Scope</div>' ) ( scope )
@@ -445,7 +457,7 @@ describe('$mdCompiler service', function() {
445
457
beforeEach ( inject ( function ( $injector ) {
446
458
$mdCompiler = $injector . get ( '$mdCompiler' ) ;
447
459
$rootScope = $injector . get ( '$rootScope' ) ;
448
- pageScope = $rootScope . $new ( ) ;
460
+ pageScope = $rootScope . $new ( false ) ;
449
461
} ) ) ;
450
462
451
463
it ( 'should assign bindings by $onInit for ES6 classes' , function ( done ) {
0 commit comments