Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Commit 610a5a0

Browse files
mbrownemhevery
authored andcommitted
docs(rootScope): correct code examples
1 parent 4f55834 commit 610a5a0

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/ng/rootScope.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ function $RootScopeProvider(){
9191
expect(scope.greeting).toEqual(undefined);
9292
9393
scope.$watch('name', function() {
94-
this.greeting = this.salutation + ' ' + this.name + '!';
94+
scope.greeting = scope.salutation + ' ' + scope.name + '!';
9595
}); // initialize the watch
9696
9797
expect(scope.greeting).toEqual(undefined);
@@ -252,7 +252,7 @@ function $RootScopeProvider(){
252252
scope.counter = 0;
253253
254254
expect(scope.counter).toEqual(0);
255-
scope.$watch('name', function(newValue, oldValue) { counter = counter + 1; });
255+
scope.$watch('name', function(newValue, oldValue) { scope.counter = scope.counter + 1; });
256256
expect(scope.counter).toEqual(0);
257257
258258
scope.$digest();
@@ -345,7 +345,7 @@ function $RootScopeProvider(){
345345
346346
expect(scope.counter).toEqual(0);
347347
scope.$watch('name', function(newValue, oldValue) {
348-
counter = counter + 1;
348+
scope.counter = scope.counter + 1;
349349
});
350350
expect(scope.counter).toEqual(0);
351351

0 commit comments

Comments
 (0)