@@ -26,17 +26,23 @@ function nullFormRenameControl(control, name) {
2626 * @property {boolean } $dirty True if user has already interacted with the form.
2727 * @property {boolean } $valid True if all of the containing forms and controls are valid.
2828 * @property {boolean } $invalid True if at least one containing control or form is invalid.
29- * @property {boolean } $pending True if at least one containing control or form is pending.
3029 * @property {boolean } $submitted True if user has submitted the form even if its invalid.
3130 *
32- * @property {Object } $error Is an object hash, containing references to controls or
33- * forms with failing validators, where:
31+ * @property {Object } $pending An object hash, containing references to controls or forms with
32+ * pending validators, where:
33+ *
34+ * - keys are validations tokens (error names).
35+ * - values are arrays of controls or forms that have a pending validator for the given error name.
36+ *
37+ * See {@link form.FormController#$error $error} for a list of built-in validation tokens.
38+ *
39+ * @property {Object } $error An object hash, containing references to controls or forms with failing
40+ * validators, where:
3441 *
3542 * - keys are validation tokens (error names),
36- * - values are arrays of controls or forms that have a failing validator for given error name.
43+ * - values are arrays of controls or forms that have a failing validator for the given error name.
3744 *
3845 * Built-in validation tokens:
39- *
4046 * - `email`
4147 * - `max`
4248 * - `maxlength`
@@ -282,9 +288,24 @@ FormController.prototype = {
282288 * @name form.FormController#$setValidity
283289 *
284290 * @description
285- * Sets the validity of a form control.
286- *
287- * This method will also propagate to parent forms.
291+ * Change the validity state of the form, and notify the parent form (if any).
292+ *
293+ * Application developers will rarely need to call this method directly. It is used internally, by
294+ * {@link ngModel.NgModelController#$setValidity NgModelController.$setValidity()}, to propagate a
295+ * control's validity state to the parent `FormController`.
296+ *
297+ * @param {string } validationErrorKey Name of the validator. The `validationErrorKey` will be
298+ * assigned to either `$error[validationErrorKey]` or `$pending[validationErrorKey]` (for
299+ * unfulfilled `$asyncValidators`), so that it is available for data-binding. The
300+ * `validationErrorKey` should be in camelCase and will get converted into dash-case for
301+ * class name. Example: `myError` will result in `ng-valid-my-error` and
302+ * `ng-invalid-my-error` classes and can be bound to as `{{ someForm.$error.myError }}`.
303+ * @param {boolean } isValid Whether the current state is valid (true), invalid (false), pending
304+ * (undefined), or skipped (null). Pending is used for unfulfilled `$asyncValidators`.
305+ * Skipped is used by AngularJS when validators do not run because of parse errors and when
306+ * `$asyncValidators` do not run because any of the `$validators` failed.
307+ * @param {NgModelController | FormController } controller - The controller whose validity state is
308+ * triggering the change.
288309 */
289310addSetValidityMethod ( {
290311 clazz : FormController ,
0 commit comments