diff --git a/docs/content/guide/migration.ngdoc b/docs/content/guide/migration.ngdoc index 46ca03ec9d02..0d4b7d3b92b4 100644 --- a/docs/content/guide/migration.ngdoc +++ b/docs/content/guide/migration.ngdoc @@ -1312,7 +1312,7 @@ jqLite/jQuery collections #### Helper Functions: -The {@link angular.lowercase `angular.lowercase`} and {@link angular.uppercase `angular.uppercase`} functions have been **deprecated** and will be removed +The `angular.lowercase` and `angular.uppercase` functions have been **deprecated** and will be removed in version 1.7.0. It is recommended to use [String.prototype.toLowerCase](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String/toLowerCase) and [String.prototype.toUpperCase](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String/toUpperCase) functions instead. @@ -1461,8 +1461,8 @@ to render error messages with ngMessages that are listed with a directive such a involves pulling error message data from a server and then displaying that data via the mechanics of ngMessages. Be sure to read the breaking change involved with `ngMessagesInclude` to upgrade your template code. -Other changes, such as the ordering of elements with ngRepeat and ngOptions and the way ngPattern and pattern directives -validate the regex, may also affect the behavior of your application. And be sure to also read up on the changes to `$cookies`. +Other changes, such as the ordering of elements with ngRepeat and ngOptions and the way ngPattern and pattern directives +validate the regex, may also affect the behavior of your application. And be sure to also read up on the changes to `$cookies`. The migration jump from 1.3 to 1.4 should be relatively straightforward otherwise. diff --git a/src/ng/directive/form.js b/src/ng/directive/form.js index 28538806fef1..b0bd565ff946 100644 --- a/src/ng/directive/form.js +++ b/src/ng/directive/form.js @@ -26,17 +26,23 @@ function nullFormRenameControl(control, name) { * @property {boolean} $dirty True if user has already interacted with the form. * @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} $pending True if at least one containing control or form is pending. * @property {boolean} $submitted True if user has submitted the form even if its invalid. * - * @property {Object} $error Is an object hash, containing references to controls or - * forms with failing validators, where: + * @property {Object} $pending An object hash, containing references to controls or forms with + * pending validators, where: + * + * - keys are validations tokens (error names). + * - values are arrays of controls or forms that have a pending validator for the given error name. + * + * See {@link form.FormController#$error $error} for a list of built-in validation tokens. + * + * @property {Object} $error An object hash, containing references to controls or forms with failing + * validators, where: * * - keys are validation tokens (error names), - * - values are arrays of controls or forms that have a failing validator for given error name. + * - values are arrays of controls or forms that have a failing validator for the given error name. * * Built-in validation tokens: - * * - `email` * - `max` * - `maxlength` @@ -282,9 +288,24 @@ FormController.prototype = { * @name form.FormController#$setValidity * * @description - * Sets the validity of a form control. - * - * This method will also propagate to parent forms. + * Change the validity state of the form, and notify the parent form (if any). + * + * Application developers will rarely need to call this method directly. It is used internally, by + * {@link ngModel.NgModelController#$setValidity NgModelController.$setValidity()}, to propagate a + * control's validity state to the parent `FormController`. + * + * @param {string} validationErrorKey Name of the validator. The `validationErrorKey` will be + * assigned to either `$error[validationErrorKey]` or `$pending[validationErrorKey]` (for + * unfulfilled `$asyncValidators`), so that it is available for data-binding. The + * `validationErrorKey` should be in camelCase and will get converted into dash-case for + * class name. Example: `myError` will result in `ng-valid-my-error` and + * `ng-invalid-my-error` classes and can be bound to as `{{ someForm.$error.myError }}`. + * @param {boolean} isValid Whether the current state is valid (true), invalid (false), pending + * (undefined), or skipped (null). Pending is used for unfulfilled `$asyncValidators`. + * Skipped is used by AngularJS when validators do not run because of parse errors and when + * `$asyncValidators` do not run because any of the `$validators` failed. + * @param {NgModelController | FormController} controller - The controller whose validity state is + * triggering the change. */ addSetValidityMethod({ clazz: FormController, diff --git a/src/ng/directive/ngModel.js b/src/ng/directive/ngModel.js index 063ebf05f003..cdba3c11de28 100644 --- a/src/ng/directive/ngModel.js +++ b/src/ng/directive/ngModel.js @@ -940,7 +940,7 @@ function setupModelWatcher(ctrl) { * (for unfulfilled `$asyncValidators`), so that it is available for data-binding. * The `validationErrorKey` should be in camelCase and will get converted into dash-case * for class name. Example: `myError` will result in `ng-valid-my-error` and `ng-invalid-my-error` - * class and can be bound to as `{{someForm.someControl.$error.myError}}` . + * classes and can be bound to as `{{ someForm.someControl.$error.myError }}`. * @param {boolean} isValid Whether the current state is valid (true), invalid (false), pending (undefined), * or skipped (null). Pending is used for unfulfilled `$asyncValidators`. * Skipped is used by AngularJS when validators do not run because of parse errors and diff --git a/src/ng/directive/select.js b/src/ng/directive/select.js index f7d63d753ac4..7b8e5b4a47d2 100644 --- a/src/ng/directive/select.js +++ b/src/ng/directive/select.js @@ -483,7 +483,7 @@ var SelectController = * the content of the `value` attribute or the textContent of the `