Skip to content

Commit 3608993

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 74db36e commit 3608993

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
@@ -15,13 +15,13 @@ var nullFormCtrl = {
1515
*
1616
* @property {boolean} $pristine True if user has not interacted with the form yet.
1717
* @property {boolean} $dirty True if user has already interacted with the form.
18-
* @property {boolean} $valid True if all of the containg forms and controls are valid.
18+
* @property {boolean} $valid True if all of the containing forms and controls are valid.
1919
* @property {boolean} $invalid True if at least one containing control or form is invalid.
2020
*
2121
* @property {Object} $error Is an object hash, containing references to all invalid controls or
2222
* forms, where:
2323
*
24-
* - keys are validation tokens (error names) — such as `REQUIRED`, `URL` or `EMAIL`),
24+
* - keys are validation tokens (error names) — such as `required`, `url` or `email`),
2525
* - values are arrays of controls or forms that are invalid with given error.
2626
*
2727
* @description
@@ -162,7 +162,7 @@ function FormController(element, attrs) {
162162
* does not allow nesting of form elements. It is useful to nest forms, for example if the validity of a
163163
* sub-group of controls needs to be determined.
164164
*
165-
* @param {string=} ngForm|name Name of the form. If specified, the form controller will be published into
165+
* @param {string=} name|ngForm Name of the form. If specified, the form controller will be published into
166166
* related scope, under this name.
167167
*
168168
*/
@@ -235,12 +235,12 @@ function FormController(element, attrs) {
235235
</script>
236236
<form name="myForm" ng-controller="Ctrl">
237237
userType: <input name="input" ng-model="userType" required>
238-
<span class="error" ng-show="myForm.input.$error.REQUIRED">Required!</span><br>
238+
<span class="error" ng-show="myForm.input.$error.required">Required!</span><br>
239239
<tt>userType = {{userType}}</tt><br>
240240
<tt>myForm.input.$valid = {{myForm.input.$valid}}</tt><br>
241241
<tt>myForm.input.$error = {{myForm.input.$error}}</tt><br>
242242
<tt>myForm.$valid = {{myForm.$valid}}</tt><br>
243-
<tt>myForm.$error.REQUIRED = {{!!myForm.$error.REQUIRED}}</tt><br>
243+
<tt>myForm.$error.required = {{!!myForm.$error.required}}</tt><br>
244244
</form>
245245
</doc:source>
246246
<doc:scenario>

0 commit comments

Comments
 (0)