aboutsummaryrefslogtreecommitdiffstats
path: root/src/ng/rootScope.js
diff options
context:
space:
mode:
authorMatthew Browne2013-01-15 11:49:42 -0500
committerMisko Hevery2013-01-17 23:11:02 -0800
commitcbc2024092b326cc7e46d4defc4bf2248bbeb835 (patch)
treebcdc26d263ddd1073c7fa959c8523ebcd3c642cc /src/ng/rootScope.js
parentf0ff7023c3d6e7ddde9dda69410432f8423dc0b0 (diff)
downloadangular.js-cbc2024092b326cc7e46d4defc4bf2248bbeb835.tar.bz2
docs(rootScope): correct code examples
Diffstat (limited to 'src/ng/rootScope.js')
-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 6ec18079..c61a577f 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);
@@ -253,7 +253,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();
@@ -346,7 +346,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);