From 854a5616bf618c9f4fc6b8ee2fceedbae48da5b5 Mon Sep 17 00:00:00 2001 From: arturovt Date: Wed, 8 Jan 2025 19:45:59 +0200 Subject: [PATCH] refactor(forms): drop `CALL_SET_DISABLED_STATE` name in production (#59430) In this commit, we drop the `CALL_SET_DISABLED_STATE` injection token name in production. PR Close #59430 --- packages/forms/src/directives/shared.ts | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/packages/forms/src/directives/shared.ts b/packages/forms/src/directives/shared.ts index 6e92de01a57..587ac4f0721 100644 --- a/packages/forms/src/directives/shared.ts +++ b/packages/forms/src/directives/shared.ts @@ -31,10 +31,13 @@ import {AsyncValidatorFn, Validator, ValidatorFn} from './validators'; * * @see {@link FormsModule#withconfig} */ -export const CALL_SET_DISABLED_STATE = new InjectionToken('CallSetDisabledState', { - providedIn: 'root', - factory: () => setDisabledStateDefault, -}); +export const CALL_SET_DISABLED_STATE = new InjectionToken( + typeof ngDevMode === 'undefined' || ngDevMode ? 'CallSetDisabledState' : '', + { + providedIn: 'root', + factory: () => setDisabledStateDefault, + }, +); /** * The type for CALL_SET_DISABLED_STATE. If `always`, then ControlValueAccessor will always call