mirror of
https://github.com/zhigang1992/angular.js.git
synced 2026-04-19 23:11:21 +08:00
docs(ngModelController): update setValidity
Needs to be `$error[validationErrorKey]!=isValid` and not `$error[validationErrorKey]=isValid`. See https://github.com/angular/angular.js/blob/master/src/ng/directive/input.js#L1627 Closes #7934
This commit is contained in:
@@ -1099,7 +1099,7 @@ var NgModelController = ['$scope', '$exceptionHandler', '$attrs', '$element', '$
|
||||
* This method should be called by validators - i.e. the parser or formatter functions.
|
||||
*
|
||||
* @param {string} validationErrorKey Name of the validator. the `validationErrorKey` will assign
|
||||
* to `$error[validationErrorKey]=isValid` so that it is available for data-binding.
|
||||
* to `$error[validationErrorKey]=!isValid` 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}}` .
|
||||
|
||||
Reference in New Issue
Block a user