From 2cf3723c13d0657f672d6a93b6b8137e7c345632 Mon Sep 17 00:00:00 2001 From: Bernhard Hofmann Date: Tue, 17 Jun 2014 09:13:56 +0100 Subject: [PATCH] ngChange might not evaluate due to ngPattern When a pattern is defined for an input field, ngChange is not evaluated if the input doesn't match the pattern. Only changes to or from matching patterns evaluate the ngChange expression. --- src/ng/directive/input.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/ng/directive/input.js b/src/ng/directive/input.js index fa6fe55d9f5e..22dc111a4b78 100644 --- a/src/ng/directive/input.js +++ b/src/ng/directive/input.js @@ -2069,7 +2069,9 @@ var ngModelDirective = function() { * 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. + * The expression is not evaluated when the value change is coming from the model + * or when the input does not match the pattern defined for the input in ngPattern. + * * * Note, this directive requires `ngModel` to be present. *