docs(ngController): clarify that this is $scope in example

Replace `this` with `$scope` in second example to highlight the fact that
we are working with the `$scope` instead of an instance of the controller
in this example.

Closes #6478
This commit is contained in:
nderoche
2014-02-27 17:32:10 +01:00
committed by Peter Bacon Darwin
parent f440ac7492
commit eaaf4967f9

View File

@@ -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) {