From ead0c953ee0e6915a9fcd00cdcd3c1c6739a0460 Mon Sep 17 00:00:00 2001 From: nderoche Date: Thu, 27 Feb 2014 17:32:10 +0100 Subject: [PATCH] Update ngController.js replaces this with $scope in second example that highlight the fact that we are using $scope instead of this --- src/ng/directive/ngController.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/ng/directive/ngController.js b/src/ng/directive/ngController.js index cbe7e833b41d..7130214ce61e 100644 --- a/src/ng/directive/ngController.js +++ b/src/ng/directive/ngController.js @@ -123,16 +123,16 @@ {type:'email', value:'john.smith@example.org'} ]; $scope.greet = function() { - alert(this.name); + alert($scope.name); }; $scope.addContact = function() { - this.contacts.push({type:'email', value:'yourname@example.org'}); + $scope.contacts.push({type:'email', value:'yourname@example.org'}); }; $scope.removeContact = function(contactToRemove) { - var index = this.contacts.indexOf(contactToRemove); - this.contacts.splice(index, 1); + var index = $scope.contacts.indexOf(contactToRemove); + $scope.contacts.splice(index, 1); }; $scope.clearContact = function(contact) {