From f484d3ba12f041dbbe7eec40e2bce49b7d133cef Mon Sep 17 00:00:00 2001 From: Matthew Browne Date: Tue, 15 Jan 2013 11:49:42 -0500 Subject: [PATCH] docs(rootScope): correct code examples --- src/ng/rootScope.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/ng/rootScope.js b/src/ng/rootScope.js index c99416f0040d..a299bb88428d 100644 --- a/src/ng/rootScope.js +++ b/src/ng/rootScope.js @@ -91,7 +91,7 @@ function $RootScopeProvider(){ expect(scope.greeting).toEqual(undefined); scope.$watch('name', function() { - this.greeting = this.salutation + ' ' + this.name + '!'; + scope.greeting = scope.salutation + ' ' + scope.name + '!'; }); // initialize the watch expect(scope.greeting).toEqual(undefined); @@ -252,7 +252,7 @@ function $RootScopeProvider(){ scope.counter = 0; expect(scope.counter).toEqual(0); - scope.$watch('name', function(newValue, oldValue) { counter = counter + 1; }); + scope.$watch('name', function(newValue, oldValue) { scope.counter = scope.counter + 1; }); expect(scope.counter).toEqual(0); scope.$digest(); @@ -345,7 +345,7 @@ function $RootScopeProvider(){ expect(scope.counter).toEqual(0); scope.$watch('name', function(newValue, oldValue) { - counter = counter + 1; + scope.counter = scope.counter + 1; }); expect(scope.counter).toEqual(0);