From c35b0a7907de1535269876668c345ce944681804 Mon Sep 17 00:00:00 2001 From: Igor Minar Date: Mon, 6 Jun 2011 22:02:30 -0700 Subject: yet another docs batch --- docs/content/cookbook/formadvanced.ngdoc | 105 ------------------------------- 1 file changed, 105 deletions(-) delete mode 100644 docs/content/cookbook/formadvanced.ngdoc (limited to 'docs/content/cookbook/formadvanced.ngdoc') diff --git a/docs/content/cookbook/formadvanced.ngdoc b/docs/content/cookbook/formadvanced.ngdoc deleted file mode 100644 index 181dd5e9..00000000 --- a/docs/content/cookbook/formadvanced.ngdoc +++ /dev/null @@ -1,105 +0,0 @@ -@workInProgress -@ngdoc overview -@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. - - - - -
- -
-

- -
-
- , - -

- - - [ add ] -
- - - [ X ] -
- - - -
- Debug View: -
form={{form}}
-    master={{master}}
-
-
- - it('should enable save button', function(){ - expect(element(':button:contains(Save)').attr('disabled')).toBeTruthy(); - input('form.name').enter(''); - expect(element(':button:contains(Save)').attr('disabled')).toBeTruthy(); - input('form.name').enter('change'); - expect(element(':button:contains(Save)').attr('disabled')).toBeFalsy(); - element(':button:contains(Save)').click(); - expect(element(':button:contains(Save)').attr('disabled')).toBeTruthy(); - }); - it('should enable cancel button', function(){ - expect(element(':button:contains(Cancel)').attr('disabled')).toBeTruthy(); - input('form.name').enter('change'); - expect(element(':button:contains(Cancel)').attr('disabled')).toBeFalsy(); - element(':button:contains(Cancel)').click(); - expect(element(':button:contains(Cancel)').attr('disabled')).toBeTruthy(); - expect(element(':input[name=form.name]').val()).toEqual('John Smith'); - }); - -
- - -#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. -* Cancel reverts the form changes back to original state. -* Save updates the internal model of the form. -* Debug view shows the two models. One presented to the user form and the other being the pristine - copy master. -- cgit v1.2.3