aboutsummaryrefslogtreecommitdiffstats
path: root/test/ScopeSpec.js
diff options
context:
space:
mode:
authorMisko Hevery2011-08-11 15:02:08 -0700
committerMisko Hevery2011-08-12 15:47:44 -0700
commit1c9fc1e1dec67c8c05f02da1e0853439238c4d8e (patch)
treeb943174db170b198924b162eac523f6d50f52245 /test/ScopeSpec.js
parent8bc7beacd80814102a6b08b83283ccf8614e44d4 (diff)
downloadangular.js-1c9fc1e1dec67c8c05f02da1e0853439238c4d8e.tar.bz2
fix(scope): rerun $digest from root, rather then per scope.
Diffstat (limited to 'test/ScopeSpec.js')
-rw-r--r--test/ScopeSpec.js9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/ScopeSpec.js b/test/ScopeSpec.js
index a2ad57a3..6105df21 100644
--- a/test/ScopeSpec.js
+++ b/test/ScopeSpec.js
@@ -178,6 +178,15 @@ describe('Scope', function(){
expect(log).toEqual('abc');
});
+ it('should repeat watch cycle from the root elemnt', function(){
+ var log = '';
+ var child = root.$new();
+ root.$watch(function(){ log += 'a'; });
+ child.$watch(function(){ log += 'b'; });
+ root.$digest();
+ expect(log).toEqual('abab');
+ });
+
it('should prevent infinite recursion', function(){
root.$watch('a', function(self, v){self.b++;});