From 3967f5f7d6c8aa7b41a5352b12f457e2fbaa251a Mon Sep 17 00:00:00 2001 From: Igor Minar Date: Mon, 22 Jul 2013 08:59:20 -0700 Subject: fix(Scope): ensure that isolate scopes use the main evalAsync queue Previously any $evalAsync task scheduled from a isolate scope or a child of an isolate scope would never execute because we never flushed this queue --- test/ng/rootScopeSpec.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'test/ng/rootScopeSpec.js') diff --git a/test/ng/rootScopeSpec.js b/test/ng/rootScopeSpec.js index 15990c96..049258cf 100644 --- a/test/ng/rootScopeSpec.js +++ b/test/ng/rootScopeSpec.js @@ -692,6 +692,19 @@ describe('Scope', function() { expect($rootScope.log).toBe('12'); })); + + it('should operate only with a single queue across all child and isolate scopes', inject(function($rootScope) { + var childScope = $rootScope.$new(); + var isolateScope = $rootScope.$new(true); + + $rootScope.$evalAsync('rootExpression'); + childScope.$evalAsync('childExpression'); + isolateScope.$evalAsync('isolateExpression'); + + expect(childScope.$$asyncQueue).toBe($rootScope.$$asyncQueue); + expect(isolateScope.$$asyncQueue).toBe($rootScope.$$asyncQueue); + expect($rootScope.$$asyncQueue).toEqual(['rootExpression', 'childExpression', 'isolateExpression']); + })); }); -- cgit v1.2.3