@@ -1114,34 +1114,34 @@ describe('Scope', function() {
1114
1114
expect ( scope . $$watchersCount ) . toBe ( 0 ) ;
1115
1115
} ) ;
1116
1116
1117
- it ( 'should maintain correct new/old values with one time bindings' , inject ( function ( $rootScope , $exceptionHandler ) {
1117
+ it ( 'should maintain correct new/old values with one time bindings' , function ( ) {
1118
1118
var newValues ;
1119
1119
var oldValues ;
1120
- $rootScope . $watchGroup ( [ 'a' , '::b' , 'b' , '4' ] , function ( n , o ) {
1120
+ scope . $watchGroup ( [ 'a' , '::b' , 'b' , '4' ] , function ( n , o ) {
1121
1121
newValues = n . slice ( ) ;
1122
1122
oldValues = o . slice ( ) ;
1123
1123
} ) ;
1124
1124
1125
- $rootScope . $apply ( ) ;
1125
+ scope . $apply ( ) ;
1126
1126
expect ( newValues ) . toEqual ( oldValues ) ;
1127
1127
expect ( oldValues ) . toEqual ( [ undefined , undefined , undefined , 4 ] ) ;
1128
1128
1129
- $rootScope . $apply ( 'a = 1' ) ;
1129
+ scope . $apply ( 'a = 1' ) ;
1130
1130
expect ( newValues ) . toEqual ( [ 1 , undefined , undefined , 4 ] ) ;
1131
1131
expect ( oldValues ) . toEqual ( [ undefined , undefined , undefined , 4 ] ) ;
1132
1132
1133
- $rootScope . $apply ( 'b = 2' ) ;
1133
+ scope . $apply ( 'b = 2' ) ;
1134
1134
expect ( newValues ) . toEqual ( [ 1 , 2 , 2 , 4 ] ) ;
1135
1135
expect ( oldValues ) . toEqual ( [ 1 , undefined , undefined , 4 ] ) ;
1136
1136
1137
- $rootScope . $apply ( 'b = 3' ) ;
1137
+ scope . $apply ( 'b = 3' ) ;
1138
1138
expect ( newValues ) . toEqual ( [ 1 , 2 , 3 , 4 ] ) ;
1139
1139
expect ( oldValues ) . toEqual ( [ 1 , 2 , 2 , 4 ] ) ;
1140
1140
1141
- $rootScope . $apply ( 'b = 4' ) ;
1141
+ scope . $apply ( 'b = 4' ) ;
1142
1142
expect ( newValues ) . toEqual ( [ 1 , 2 , 4 , 4 ] ) ;
1143
1143
expect ( oldValues ) . toEqual ( [ 1 , 2 , 3 , 4 ] ) ;
1144
- } ) ) ;
1144
+ } ) ;
1145
1145
} ) ;
1146
1146
1147
1147
describe ( '$watchGroup with logging $exceptionHandler' , function ( ) {
@@ -1150,36 +1150,36 @@ describe('Scope', function() {
1150
1150
$exceptionHandlerProvider . mode ( 'log' ) ;
1151
1151
} ) ;
1152
1152
1153
- inject ( function ( $rootScope , $ exceptionHandler) {
1153
+ inject ( function ( $exceptionHandler ) {
1154
1154
var newValues ;
1155
1155
var oldValues ;
1156
- $rootScope . $watchGroup ( [ 'a' , '::b' , 'b' , '4' ] , function ( n , o ) {
1156
+ scope . $watchGroup ( [ 'a' , '::b' , 'b' , '4' ] , function ( n , o ) {
1157
1157
newValues = n . slice ( ) ;
1158
1158
oldValues = o . slice ( ) ;
1159
1159
throw 'test' ;
1160
1160
} ) ;
1161
1161
1162
- $rootScope . $apply ( ) ;
1162
+ scope . $apply ( ) ;
1163
1163
expect ( newValues ) . toEqual ( oldValues ) ;
1164
1164
expect ( oldValues ) . toEqual ( [ undefined , undefined , undefined , 4 ] ) ;
1165
1165
expect ( $exceptionHandler . errors . length ) . toBe ( 1 ) ;
1166
1166
1167
- $rootScope . $apply ( 'a = 1' ) ;
1167
+ scope . $apply ( 'a = 1' ) ;
1168
1168
expect ( newValues ) . toEqual ( [ 1 , undefined , undefined , 4 ] ) ;
1169
1169
expect ( oldValues ) . toEqual ( [ undefined , undefined , undefined , 4 ] ) ;
1170
1170
expect ( $exceptionHandler . errors . length ) . toBe ( 2 ) ;
1171
1171
1172
- $rootScope . $apply ( 'b = 2' ) ;
1172
+ scope . $apply ( 'b = 2' ) ;
1173
1173
expect ( newValues ) . toEqual ( [ 1 , 2 , 2 , 4 ] ) ;
1174
1174
expect ( oldValues ) . toEqual ( [ 1 , undefined , undefined , 4 ] ) ;
1175
1175
expect ( $exceptionHandler . errors . length ) . toBe ( 3 ) ;
1176
1176
1177
- $rootScope . $apply ( 'b = 3' ) ;
1177
+ scope . $apply ( 'b = 3' ) ;
1178
1178
expect ( newValues ) . toEqual ( [ 1 , 2 , 3 , 4 ] ) ;
1179
1179
expect ( oldValues ) . toEqual ( [ 1 , 2 , 2 , 4 ] ) ;
1180
1180
expect ( $exceptionHandler . errors . length ) . toBe ( 4 ) ;
1181
1181
1182
- $rootScope . $apply ( 'b = 4' ) ;
1182
+ scope . $apply ( 'b = 4' ) ;
1183
1183
expect ( newValues ) . toEqual ( [ 1 , 2 , 4 , 4 ] ) ;
1184
1184
expect ( oldValues ) . toEqual ( [ 1 , 2 , 3 , 4 ] ) ;
1185
1185
expect ( $exceptionHandler . errors . length ) . toBe ( 5 ) ;
0 commit comments