diff options
| author | Igor Minar | 2012-06-10 09:01:42 -0700 |
|---|---|---|
| committer | Igor Minar | 2012-06-10 09:01:42 -0700 |
| commit | 5d70e4a89cd9b3d430bb81f438cf03e956d9a9d2 (patch) | |
| tree | 2a9311d9735c938321e581b22fb3e06c40839385 /docs/content/cookbook/form.ngdoc | |
| parent | b5bba65a9353ca9dc03b8d0c3c9b06d9c4cdacdf (diff) | |
| download | angular.js-5d70e4a89cd9b3d430bb81f438cf03e956d9a9d2.tar.bz2 | |
docs(*): fix various outdated docs and examples
Closes #1030
Diffstat (limited to 'docs/content/cookbook/form.ngdoc')
| -rw-r--r-- | docs/content/cookbook/form.ngdoc | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/docs/content/cookbook/form.ngdoc b/docs/content/cookbook/form.ngdoc index f746e327..829547f4 100644 --- a/docs/content/cookbook/form.ngdoc +++ b/docs/content/cookbook/form.ngdoc @@ -11,7 +11,7 @@ allow a user to enter data. <doc:source> <script> function FormController($scope) { - $scope.user = { + var user = $scope.user = { name: 'John Smith', address:{line1: '123 Main St.', city:'Anytown', state:'AA', zip:'12345'}, contacts:[{type:'phone', value:'1(234) 555-1212'}] @@ -20,12 +20,12 @@ allow a user to enter data. $scope.zip = /^\d\d\d\d\d$/; $scope.addContact = function() { - $scope.user.contacts.push({type:'email', value:''}); + user.contacts.push({type:'email', value:''}); }; $scope.removeContact = function(contact) { - for (var i = 0, ii = this.user.contacts.length; i < ii; i++) { - if (contact === this.user.contacts[i]) { + for (var i = 0, ii = user.contacts.length; i < ii; i++) { + if (contact === user.contacts[i]) { $scope.user.contacts.splice(i, 1); } } |
