aboutsummaryrefslogtreecommitdiffstats
path: root/src/ng/directive/input.js
diff options
context:
space:
mode:
authorAndreas Gruenbacher2014-01-05 16:58:32 +0100
committerCaitlin Potter2014-01-17 16:40:10 -0500
commit5adea0ba64b758f8f5700da73f6faca8ae1983be (patch)
tree2982ebb1a4b647d2df1fa1c11b2b6b2efa387246 /src/ng/directive/input.js
parent2262ca66978cb055013703e2c2b8f0f5cf20ac05 (diff)
downloadangular.js-5adea0ba64b758f8f5700da73f6faca8ae1983be.tar.bz2
docs(ngChange): clarify difference between ng-change DOM change event
The ng-change event triggers immediately, which makes a difference for text input fields and text areas, where the JavaScript onchange event would only be called at the end of the change. Closes #5640
Diffstat (limited to 'src/ng/directive/input.js')
-rw-r--r--src/ng/directive/input.js5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/ng/directive/input.js b/src/ng/directive/input.js
index 4e773978..fbcf3b32 100644
--- a/src/ng/directive/input.js
+++ b/src/ng/directive/input.js
@@ -1188,7 +1188,10 @@ var ngModelDirective = function() {
* @name ng.directive:ngChange
*
* @description
- * Evaluate given expression when user changes the input.
+ * Evaluate the given expression when the user changes the input.
+ * The expression is evaluated immediately, unlike the JavaScript onchange event
+ * which only triggers at the end of a change (usually, when the user leaves the
+ * form element or presses the return key).
* The expression is not evaluated when the value change is coming from the model.
*
* Note, this directive requires `ngModel` to be present.