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/deeplinking.ngdoc | 2 +- docs/content/cookbook/form.ngdoc | 2 +- docs/content/cookbook/formadvanced.ngdoc | 105 ------------------------------- 3 files changed, 2 insertions(+), 107 deletions(-) delete mode 100644 docs/content/cookbook/formadvanced.ngdoc (limited to 'docs/content/cookbook') diff --git a/docs/content/cookbook/deeplinking.ngdoc b/docs/content/cookbook/deeplinking.ngdoc index cc748b3f..6cc0b356 100644 --- a/docs/content/cookbook/deeplinking.ngdoc +++ b/docs/content/cookbook/deeplinking.ngdoc @@ -44,11 +44,11 @@ In this example we have a simple app which consist of two screens: The two partials are defined in the following URLs: + * {@link ./examples/settings.html} * {@link ./examples/welcome.html} - -
- -
-

- -
-
- , - -

- - - [ 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