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