diff options
| author | Igor Minar | 2011-06-15 22:31:40 -0700 |
|---|---|---|
| committer | Igor Minar | 2011-06-15 22:31:40 -0700 |
| commit | b842642b574a2b95c53b791308ed1bf8ff9d304d (patch) | |
| tree | fb26431c5372be74de2105df77e94dea4f198489 /docs/content/cookbook/advancedform.ngdoc | |
| parent | d428c9910e66246c2af46602499acaeaf187d75b (diff) | |
| download | angular.js-b842642b574a2b95c53b791308ed1bf8ff9d304d.tar.bz2 | |
docs - stripping extra new lines
Diffstat (limited to 'docs/content/cookbook/advancedform.ngdoc')
| -rw-r--r-- | docs/content/cookbook/advancedform.ngdoc | 11 |
1 files changed, 0 insertions, 11 deletions
diff --git a/docs/content/cookbook/advancedform.ngdoc b/docs/content/cookbook/advancedform.ngdoc index 747e8891..bbf4875e 100644 --- a/docs/content/cookbook/advancedform.ngdoc +++ b/docs/content/cookbook/advancedform.ngdoc @@ -3,11 +3,9 @@ @name Cookbook: Advanced Form @description - Here we extend the basic form example to include common features such as reverting, dirty state detection, and preventing invalid form submission. - <doc:example> <doc:source> <script> @@ -31,13 +29,11 @@ detection, and preventing invalid form submission. this.cancel(); } - UserForm.prototype = { cancel: function(){ this.form = angular.copy(this.master); }, - save: function(){ this.master = this.form; this.cancel(); @@ -46,11 +42,9 @@ detection, and preventing invalid form submission. </script> <div ng:controller="UserForm"> - <label>Name:</label><br/> <input type="text" name="form.name" ng:required/> <br/><br/> - <label>Address:</label><br/> <input type="text" name="form.address.line1" size="33" ng:required/> <br/> <input type="text" name="form.address.city" size="12" ng:required/>, @@ -58,7 +52,6 @@ detection, and preventing invalid form submission. <input type="text" name="form.address.zip" size="5" ng:required ng:validate="regexp:zip"/><br/><br/> - <label>Contacts:</label> [ <a href="" ng:click="form.contacts.$add()">add</a> ] <div ng:repeat="contact in form.contacts"> @@ -75,7 +68,6 @@ ng:validate="regexp:zip"/><br/><br/> <button ng:click="save()" ng:disabled="{{$invalidWidgets.visible() || master.$equals(form)}}">Save</button> - <hr/> Debug View: <pre>form={{form}} @@ -104,11 +96,8 @@ master.$equals(form)}}">Save</button> </doc:example> - - #Things to notice - * Cancel & save buttons are only enabled if the form is dirty — there is something to cancel or save. * Save button is only enabled if there are no validation errors on the form. |
