mirror of
https://github.com/Hopiu/angular.js.git
synced 2026-05-08 23:04:45 +00:00
docs(form): minor form doc and example fixes
Form documentation fixes: - Fix broken form example in docs - A few small other corrections in form docs.
This commit is contained in:
parent
f3188c1d09
commit
23cd40a8ec
1 changed files with 5 additions and 5 deletions
|
|
@ -14,13 +14,13 @@ var nullFormCtrl = {
|
||||||
*
|
*
|
||||||
* @property {boolean} $pristine True if user has not interacted with the form yet.
|
* @property {boolean} $pristine True if user has not interacted with the form yet.
|
||||||
* @property {boolean} $dirty True if user has already interacted with the form.
|
* @property {boolean} $dirty True if user has already interacted with the form.
|
||||||
* @property {boolean} $valid True if all of the containg forms and controls are valid.
|
* @property {boolean} $valid True if all of the containing forms and controls are valid.
|
||||||
* @property {boolean} $invalid True if at least one containing control or form is invalid.
|
* @property {boolean} $invalid True if at least one containing control or form is invalid.
|
||||||
*
|
*
|
||||||
* @property {Object} $error Is an object hash, containing references to all invalid controls or
|
* @property {Object} $error Is an object hash, containing references to all invalid controls or
|
||||||
* forms, where:
|
* forms, where:
|
||||||
*
|
*
|
||||||
* - keys are validation tokens (error names) — such as `REQUIRED`, `URL` or `EMAIL`),
|
* - keys are validation tokens (error names) — such as `required`, `url` or `email`),
|
||||||
* - values are arrays of controls or forms that are invalid with given error.
|
* - values are arrays of controls or forms that are invalid with given error.
|
||||||
*
|
*
|
||||||
* @description
|
* @description
|
||||||
|
|
@ -133,7 +133,7 @@ function FormController(element, attrs) {
|
||||||
* does not allow nesting of form elements. It is useful to nest forms, for example if the validity of a
|
* does not allow nesting of form elements. It is useful to nest forms, for example if the validity of a
|
||||||
* sub-group of controls needs to be determined.
|
* sub-group of controls needs to be determined.
|
||||||
*
|
*
|
||||||
* @param {string=} ngForm|name Name of the form. If specified, the form controller will be published into
|
* @param {string=} name|ngForm Name of the form. If specified, the form controller will be published into
|
||||||
* related scope, under this name.
|
* related scope, under this name.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
@ -206,12 +206,12 @@ function FormController(element, attrs) {
|
||||||
</script>
|
</script>
|
||||||
<form name="myForm" ng-controller="Ctrl">
|
<form name="myForm" ng-controller="Ctrl">
|
||||||
userType: <input name="input" ng-model="userType" required>
|
userType: <input name="input" ng-model="userType" required>
|
||||||
<span class="error" ng-show="myForm.input.$error.REQUIRED">Required!</span><br>
|
<span class="error" ng-show="myForm.input.$error.required">Required!</span><br>
|
||||||
<tt>userType = {{userType}}</tt><br>
|
<tt>userType = {{userType}}</tt><br>
|
||||||
<tt>myForm.input.$valid = {{myForm.input.$valid}}</tt><br>
|
<tt>myForm.input.$valid = {{myForm.input.$valid}}</tt><br>
|
||||||
<tt>myForm.input.$error = {{myForm.input.$error}}</tt><br>
|
<tt>myForm.input.$error = {{myForm.input.$error}}</tt><br>
|
||||||
<tt>myForm.$valid = {{myForm.$valid}}</tt><br>
|
<tt>myForm.$valid = {{myForm.$valid}}</tt><br>
|
||||||
<tt>myForm.$error.REQUIRED = {{!!myForm.$error.REQUIRED}}</tt><br>
|
<tt>myForm.$error.required = {{!!myForm.$error.required}}</tt><br>
|
||||||
</form>
|
</form>
|
||||||
</doc:source>
|
</doc:source>
|
||||||
<doc:scenario>
|
<doc:scenario>
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue