diff options
| author | Peter Bacon Darwin | 2014-02-12 22:47:42 +0000 | 
|---|---|---|
| committer | Peter Bacon Darwin | 2014-02-16 19:03:41 +0000 | 
| commit | a564160511bf1bbed5a4fe5d2981fae1bb664eca (patch) | |
| tree | 16fe76a5c8a4e75c50db5f15224f1b954060cd38 /docs/content/guide/forms.ngdoc | |
| parent | 06f2ba899fac8ad004bf65dce39a3b05e2387c0f (diff) | |
| download | angular.js-a564160511bf1bbed5a4fe5d2981fae1bb664eca.tar.bz2 | |
docs(bike-shed-migration): fix url-based links refs to AUTO module
Diffstat (limited to 'docs/content/guide/forms.ngdoc')
| -rw-r--r-- | docs/content/guide/forms.ngdoc | 24 | 
1 files changed, 12 insertions, 12 deletions
| diff --git a/docs/content/guide/forms.ngdoc b/docs/content/guide/forms.ngdoc index 84ee4330..d5f59d18 100644 --- a/docs/content/guide/forms.ngdoc +++ b/docs/content/guide/forms.ngdoc @@ -12,9 +12,9 @@ Server-side validation is still necessary for a secure application.  # Simple form -The key directive in understanding two-way data-binding is {@link api/ng.directive:ngModel ngModel}. +The key directive in understanding two-way data-binding is {@link ng.directive:ngModel ngModel}.  The `ngModel` directive provides the two-way data-binding by synchronizing the model to the view, as well as view to the model. -In addition it provides an {@link api/ng.directive:ngModel.NgModelController API} for other directives to augment its behavior. +In addition it provides an {@link ng.directive:ngModel.NgModelController API} for other directives to augment its behavior.  <doc:example>  <doc:source> @@ -113,11 +113,11 @@ This ensures that the user is not distracted with an error until after interacti  # Binding to form and control state -A form is an instance of {@link api/ng.directive:form.FormController FormController}. +A form is an instance of {@link ng.directive:form.FormController FormController}.  The form instance can optionally be published into the scope using the `name` attribute. -Similarly, an input control that has the {@link api/ng.directive:ngModel ngModel} directive holds an -instance of {@link api/ng.directive:ngModel.NgModelController NgModelController}. +Similarly, an input control that has the {@link ng.directive:ngModel ngModel} directive holds an +instance of {@link ng.directive:ngModel.NgModelController NgModelController}.  Such a control instance can be published as a property of the form instance using the `name` attribute  on the input control.  The name attribute specifies the name of the property on the form instance. @@ -183,19 +183,19 @@ This allows us to extend the above example with these features:  # Custom Validation -Angular provides basic implementation for most common html5 {@link api/ng.directive:input input} -types: ({@link api/ng.directive:input.text text}, {@link api/ng.directive:input.number number}, {@link api/ng.directive:input.url url}, {@link api/ng.directive:input.email email}, {@link api/ng.directive:input.radio radio}, {@link api/ng.directive:input.checkbox checkbox}), as well as some directives for validation (`required`, `pattern`, `minlength`, `maxlength`, `min`, `max`). +Angular provides basic implementation for most common html5 {@link ng.directive:input input} +types: ({@link ng.directive:input.text text}, {@link ng.directive:input.number number}, {@link ng.directive:input.url url}, {@link ng.directive:input.email email}, {@link ng.directive:input.radio radio}, {@link ng.directive:input.checkbox checkbox}), as well as some directives for validation (`required`, `pattern`, `minlength`, `maxlength`, `min`, `max`). -Defining your own validator can be done by defining your own directive which adds a custom validation function to the `ngModel` {@link api/ng.directive:ngModel.NgModelController controller}. +Defining your own validator can be done by defining your own directive which adds a custom validation function to the `ngModel` {@link ng.directive:ngModel.NgModelController controller}.  To get a hold of the controller the directive specifies a dependency as shown in the example below.  The validation can occur in two places:    * **Model to View update** - -    Whenever the bound model changes, all functions in {@link api/ng.directive:ngModel.NgModelController#properties_$formatters NgModelController#$formatters} array are pipe-lined, so that each of these functions has an opportunity to format the value and change validity state of the form control through {@link api/ng.directive:ngModel.NgModelController#methods_$setValidity NgModelController#$setValidity}. +    Whenever the bound model changes, all functions in {@link ng.directive:ngModel.NgModelController#properties_$formatters NgModelController#$formatters} array are pipe-lined, so that each of these functions has an opportunity to format the value and change validity state of the form control through {@link ng.directive:ngModel.NgModelController#methods_$setValidity NgModelController#$setValidity}.    * **View to Model update** - -    In a similar way, whenever a user interacts with a control it calls {@link api/ng.directive:ngModel.NgModelController#methods_$setViewValue NgModelController#$setViewValue}. -This in turn pipelines all functions in the {@link api/ng.directive:ngModel.NgModelController#properties_$parsers NgModelController#$parsers} array, so that each of these functions has an opportunity to convert the value and change validity state of the form control through {@link api/ng.directive:ngModel.NgModelController#methods_$setValidity NgModelController#$setValidity}. +    In a similar way, whenever a user interacts with a control it calls {@link ng.directive:ngModel.NgModelController#methods_$setViewValue NgModelController#$setViewValue}. +This in turn pipelines all functions in the {@link ng.directive:ngModel.NgModelController#properties_$parsers NgModelController#$parsers} array, so that each of these functions has an opportunity to convert the value and change validity state of the form control through {@link ng.directive:ngModel.NgModelController#methods_$setValidity NgModelController#$setValidity}.  In the following example we create two directives. @@ -278,7 +278,7 @@ In the following example we create two directives.  # Implementing custom form controls (using `ngModel`) -Angular implements all of the basic HTML form controls ({@link api/ng.directive:input input}, {@link api/ng.directive:select select}, {@link api/ng.directive:textarea textarea}), which should be sufficient for most cases. +Angular implements all of the basic HTML form controls ({@link ng.directive:input input}, {@link ng.directive:select select}, {@link ng.directive:textarea textarea}), which should be sufficient for most cases.  However, if you need more flexibility, you can write your own form control as a directive.  In order for custom control to work with `ngModel` and to achieve two-way data-binding it needs to: | 
