This repository was archived by the owner on Apr 12, 2024. It is now read-only.
File tree 2 files changed +15
-0
lines changed
2 files changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -165,6 +165,8 @@ function $RootScopeProvider(){
165
165
if ( isolate ) {
166
166
child = new Scope ( ) ;
167
167
child . $root = this . $root ;
168
+ // ensure that there is just one async queue per $rootScope and it's children
169
+ child . $$asyncQueue = this . $$asyncQueue ;
168
170
} else {
169
171
Child = function ( ) { } ; // should be anonymous; This is so that when the minifier munges
170
172
// the name it does not become random set of chars. These will then show up as class
Original file line number Diff line number Diff line change @@ -692,6 +692,19 @@ describe('Scope', function() {
692
692
expect ( $rootScope . log ) . toBe ( '12' ) ;
693
693
} ) ) ;
694
694
695
+
696
+ it ( 'should operate only with a single queue across all child and isolate scopes' , inject ( function ( $rootScope ) {
697
+ var childScope = $rootScope . $new ( ) ;
698
+ var isolateScope = $rootScope . $new ( true ) ;
699
+
700
+ $rootScope . $evalAsync ( 'rootExpression' ) ;
701
+ childScope . $evalAsync ( 'childExpression' ) ;
702
+ isolateScope . $evalAsync ( 'isolateExpression' ) ;
703
+
704
+ expect ( childScope . $$asyncQueue ) . toBe ( $rootScope . $$asyncQueue ) ;
705
+ expect ( isolateScope . $$asyncQueue ) . toBe ( $rootScope . $$asyncQueue ) ;
706
+ expect ( $rootScope . $$asyncQueue ) . toEqual ( [ 'rootExpression' , 'childExpression' , 'isolateExpression' ] ) ;
707
+ } ) ) ;
695
708
} ) ;
696
709
697
710
You can’t perform that action at this time.
0 commit comments