Skip to content

Commit 854a561

Browse files
arturovtkirjs
authored andcommitted
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
1 parent e689aae commit 854a561

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

packages/forms/src/directives/shared.ts

+7-4
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,13 @@ import {AsyncValidatorFn, Validator, ValidatorFn} from './validators';
3131
*
3232
* @see {@link FormsModule#withconfig}
3333
*/
34-
export const CALL_SET_DISABLED_STATE = new InjectionToken('CallSetDisabledState', {
35-
providedIn: 'root',
36-
factory: () => setDisabledStateDefault,
37-
});
34+
export const CALL_SET_DISABLED_STATE = new InjectionToken(
35+
typeof ngDevMode === 'undefined' || ngDevMode ? 'CallSetDisabledState' : '',
36+
{
37+
providedIn: 'root',
38+
factory: () => setDisabledStateDefault,
39+
},
40+
);
3841

3942
/**
4043
* The type for CALL_SET_DISABLED_STATE. If `always`, then ControlValueAccessor will always call

0 commit comments

Comments
 (0)