Skip to content

Commit 23cd40a

Browse files
jonbcardpkozlowski-opensource
authored andcommitted
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.
1 parent f3188c1 commit 23cd40a

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/ng/directive/form.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@ var nullFormCtrl = {
1414
*
1515
* @property {boolean} $pristine True if user has not interacted with the form yet.
1616
* @property {boolean} $dirty True if user has already interacted with the form.
17-
* @property {boolean} $valid True if all of the containg forms and controls are valid.
17+
* @property {boolean} $valid True if all of the containing forms and controls are valid.
1818
* @property {boolean} $invalid True if at least one containing control or form is invalid.
1919
*
2020
* @property {Object} $error Is an object hash, containing references to all invalid controls or
2121
* forms, where:
2222
*
23-
* - keys are validation tokens (error names) — such as `REQUIRED`, `URL` or `EMAIL`),
23+
* - keys are validation tokens (error names) — such as `required`, `url` or `email`),
2424
* - values are arrays of controls or forms that are invalid with given error.
2525
*
2626
* @description
@@ -133,7 +133,7 @@ function FormController(element, attrs) {
133133
* does not allow nesting of form elements. It is useful to nest forms, for example if the validity of a
134134
* sub-group of controls needs to be determined.
135135
*
136-
* @param {string=} ngForm|name Name of the form. If specified, the form controller will be published into
136+
* @param {string=} name|ngForm Name of the form. If specified, the form controller will be published into
137137
* related scope, under this name.
138138
*
139139
*/
@@ -206,12 +206,12 @@ function FormController(element, attrs) {
206206
</script>
207207
<form name="myForm" ng-controller="Ctrl">
208208
userType: <input name="input" ng-model="userType" required>
209-
<span class="error" ng-show="myForm.input.$error.REQUIRED">Required!</span><br>
209+
<span class="error" ng-show="myForm.input.$error.required">Required!</span><br>
210210
<tt>userType = {{userType}}</tt><br>
211211
<tt>myForm.input.$valid = {{myForm.input.$valid}}</tt><br>
212212
<tt>myForm.input.$error = {{myForm.input.$error}}</tt><br>
213213
<tt>myForm.$valid = {{myForm.$valid}}</tt><br>
214-
<tt>myForm.$error.REQUIRED = {{!!myForm.$error.REQUIRED}}</tt><br>
214+
<tt>myForm.$error.required = {{!!myForm.$error.required}}</tt><br>
215215
</form>
216216
</doc:source>
217217
<doc:scenario>

0 commit comments

Comments
 (0)