From 9c0639437607a4fcea379bbaf610600d05d8a9b7 Mon Sep 17 00:00:00 2001 From: Misko Hevery Date: Tue, 8 Nov 2011 17:40:52 -0800 Subject: chore(scenario tests): make scenario tests pass again --- docs/content/cookbook/form.ngdoc | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'docs/content/cookbook/form.ngdoc') diff --git a/docs/content/cookbook/form.ngdoc b/docs/content/cookbook/form.ngdoc index 6cd1d83a..1b5bf32b 100644 --- a/docs/content/cookbook/form.ngdoc +++ b/docs/content/cookbook/form.ngdoc @@ -18,6 +18,18 @@ allow a user to enter data. }; this.state = /^\w\w$/; this.zip = /^\d\d\d\d\d$/; + + this.addContact = function() { + this.user.contacts.push({type:'', value:''}); + }; + + this.removeContact = function(contact) { + for ( var i = 0, ii = this.user.contacts.length; i < ii; i++) { + if (contact === this.user.contacts[i]) { + this.user.contacts.splice(i, 1); + } + } + }; }