Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 583f37d

Browse filesBrowse files
docs(ngChange): clarify when the ngChange expression is evaluated
Closes angular#7866
1 parent 4152155 commit 583f37d
Copy full SHA for 583f37d

File tree

Expand file treeCollapse file tree

1 file changed

+9
-3
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+9
-3
lines changed
Open diff view settings
Collapse file

‎src/ng/directive/input.js‎

Copy file name to clipboardExpand all lines: src/ng/directive/input.js
+9-3Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2201,9 +2201,15 @@ var ngModelDirective = function() {
22012201
* The expression is evaluated immediately, unlike the JavaScript onchange event
22022202
* which only triggers at the end of a change (usually, when the user leaves the
22032203
* form element or presses the return key).
2204-
* The expression is not evaluated when the value change is coming from the model
2205-
* or when the input does not match the pattern defined for the input in ngPattern.
2206-
*
2204+
*
2205+
* The `ngChange` expression is only evaluated when a change in the input value causes
2206+
* a new value to be committed to the model.
2207+
*
2208+
* It will not be evaluated:
2209+
* * if the value returned from the `$parsers` transformation pipeline has not changed
2210+
* * if the input has continued to be invalid since the model will stay `null`
2211+
* * if the model is changed programmatically and not by a change to the input value
2212+
*
22072213
*
22082214
* Note, this directive requires `ngModel` to be present.
22092215
*

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.