Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Commit 5adea0b

Browse files
andreas-gruenbachercaitp
authored andcommitted
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
1 parent 2262ca6 commit 5adea0b

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/ng/directive/input.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -1188,7 +1188,10 @@ var ngModelDirective = function() {
11881188
* @name ng.directive:ngChange
11891189
*
11901190
* @description
1191-
* Evaluate given expression when user changes the input.
1191+
* Evaluate the given expression when the user changes the input.
1192+
* The expression is evaluated immediately, unlike the JavaScript onchange event
1193+
* which only triggers at the end of a change (usually, when the user leaves the
1194+
* form element or presses the return key).
11921195
* The expression is not evaluated when the value change is coming from the model.
11931196
*
11941197
* Note, this directive requires `ngModel` to be present.

0 commit comments

Comments
 (0)