aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Browne2013-01-15 11:49:42 -0500
committerMisko Hevery2013-01-17 23:08:38 -0800
commit610a5a0c14a71be6cd147c665f80478515bfb576 (patch)
tree867994398443a1b47b614ed7b7c1b1e3a5ca7d7d
parent4f5583465a03ad032416b655be4450138d852d4c (diff)
downloadangular.js-610a5a0c14a71be6cd147c665f80478515bfb576.tar.bz2
docs(rootScope): correct code examples
-rw-r--r--src/ng/rootScope.js6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/ng/rootScope.js b/src/ng/rootScope.js
index c99416f0..a299bb88 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);