Skip to content

Commit 91e5dd5

Browse files
Merge pull request #26 from angular/master
Update upstream
2 parents 247ea91 + 9bcdfcf commit 91e5dd5

File tree

4 files changed

+34
-13
lines changed

4 files changed

+34
-13
lines changed

docs/content/guide/migration.ngdoc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1312,7 +1312,7 @@ jqLite/jQuery collections
13121312

13131313
#### Helper Functions:
13141314

1315-
The {@link angular.lowercase `angular.lowercase`} and {@link angular.uppercase `angular.uppercase`} functions have been **deprecated** and will be removed
1315+
The `angular.lowercase` and `angular.uppercase` functions have been **deprecated** and will be removed
13161316
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.
13171317

13181318

@@ -1461,8 +1461,8 @@ to render error messages with ngMessages that are listed with a directive such a
14611461
involves pulling error message data from a server and then displaying that data via the mechanics of ngMessages. Be
14621462
sure to read the breaking change involved with `ngMessagesInclude` to upgrade your template code.
14631463

1464-
Other changes, such as the ordering of elements with ngRepeat and ngOptions and the way ngPattern and pattern directives
1465-
validate the regex, may also affect the behavior of your application. And be sure to also read up on the changes to `$cookies`.
1464+
Other changes, such as the ordering of elements with ngRepeat and ngOptions and the way ngPattern and pattern directives
1465+
validate the regex, may also affect the behavior of your application. And be sure to also read up on the changes to `$cookies`.
14661466
The migration jump from 1.3 to 1.4 should be relatively straightforward otherwise.
14671467

14681468

src/ng/directive/form.js

Lines changed: 29 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -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
*/
289310
addSetValidityMethod({
290311
clazz: FormController,

src/ng/directive/ngModel.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -940,7 +940,7 @@ function setupModelWatcher(ctrl) {
940940
* (for unfulfilled `$asyncValidators`), so that it is available for data-binding.
941941
* The `validationErrorKey` should be in camelCase and will get converted into dash-case
942942
* for class name. Example: `myError` will result in `ng-valid-my-error` and `ng-invalid-my-error`
943-
* class and can be bound to as `{{someForm.someControl.$error.myError}}` .
943+
* classes and can be bound to as `{{ someForm.someControl.$error.myError }}`.
944944
* @param {boolean} isValid Whether the current state is valid (true), invalid (false), pending (undefined),
945945
* or skipped (null). Pending is used for unfulfilled `$asyncValidators`.
946946
* Skipped is used by AngularJS when validators do not run because of parse errors and

src/ng/directive/select.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -483,7 +483,7 @@ var SelectController =
483483
* the content of the `value` attribute or the textContent of the `<option>`, if the value attribute is missing.
484484
* Value and textContent can be interpolated.
485485
*
486-
* The {@link select.selectController select controller} exposes utility functions that can be used
486+
* The {@link select.SelectController select controller} exposes utility functions that can be used
487487
* to manipulate the select's behavior.
488488
*
489489
* ## Matching model and option values

0 commit comments

Comments
 (0)