From 9d1dbd51c2a26251ba8a29fcb8461d9564237599 Mon Sep 17 00:00:00 2001 From: Martin Staffa Date: Thu, 17 Mar 2016 17:19:12 +0100 Subject: [PATCH] refactor(input): remove $$parserName from email, url Since email and url don't use $parsers, we do not need to set the parserName. This also reduces the number of times the valid / invalid classes are set within for the input or possible parent forms. This was discovered when fixing #14249. The additional class settings triggered a cancellation of the structural animation. A general fix for this behavior has landed as --- src/ng/directive/input.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/ng/directive/input.js b/src/ng/directive/input.js index 3e551fe0e85d..efadbcda15d2 100644 --- a/src/ng/directive/input.js +++ b/src/ng/directive/input.js @@ -1440,7 +1440,6 @@ function urlInputType(scope, element, attr, ctrl, $sniffer, $browser) { baseInputType(scope, element, attr, ctrl, $sniffer, $browser); stringBasedInputType(ctrl); - ctrl.$$parserName = 'url'; ctrl.$validators.url = function(modelValue, viewValue) { var value = modelValue || viewValue; return ctrl.$isEmpty(value) || URL_REGEXP.test(value); @@ -1448,12 +1447,11 @@ function urlInputType(scope, element, attr, ctrl, $sniffer, $browser) { } function emailInputType(scope, element, attr, ctrl, $sniffer, $browser) { - // Note: no badInputChecker here by purpose as `url` is only a validation + // Note: no badInputChecker here by purpose as `email` is only a validation // in browsers, i.e. we can always read out input.value even if it is not valid! baseInputType(scope, element, attr, ctrl, $sniffer, $browser); stringBasedInputType(ctrl); - ctrl.$$parserName = 'email'; ctrl.$validators.email = function(modelValue, viewValue) { var value = modelValue || viewValue; return ctrl.$isEmpty(value) || EMAIL_REGEXP.test(value);