mirror of
https://github.com/angular/angular
synced 2026-05-24 09:28:37 +00:00
refactor(core): correct all typeof ngDevMode comparison patterns introduced by #63875
This change replaces all remaining occurrences of `typeof ngDevMode !== undefined`
with the correct `typeof ngDevMode !== 'undefined'` form. This aligns the codebase
with JavaScript typeof semantics and maintains consistency with other Angular code.
(cherry picked from commit 96b79fc393)
This commit is contained in:
parent
a4c436a058
commit
288238abef
40 changed files with 58 additions and 58 deletions
|
|
@ -192,14 +192,14 @@ export function chainedInterceptorFn(
|
|||
* @publicApi
|
||||
*/
|
||||
export const HTTP_INTERCEPTORS = new InjectionToken<readonly HttpInterceptor[]>(
|
||||
typeof ngDevMode !== undefined && ngDevMode ? 'HTTP_INTERCEPTORS' : '',
|
||||
typeof ngDevMode !== 'undefined' && ngDevMode ? 'HTTP_INTERCEPTORS' : '',
|
||||
);
|
||||
|
||||
/**
|
||||
* A multi-provided token of `HttpInterceptorFn`s.
|
||||
*/
|
||||
export const HTTP_INTERCEPTOR_FNS = new InjectionToken<readonly HttpInterceptorFn[]>(
|
||||
typeof ngDevMode !== undefined && ngDevMode ? 'HTTP_INTERCEPTOR_FNS' : '',
|
||||
typeof ngDevMode !== 'undefined' && ngDevMode ? 'HTTP_INTERCEPTOR_FNS' : '',
|
||||
{factory: () => []},
|
||||
);
|
||||
|
||||
|
|
@ -207,14 +207,14 @@ export const HTTP_INTERCEPTOR_FNS = new InjectionToken<readonly HttpInterceptorF
|
|||
* A multi-provided token of `HttpInterceptorFn`s that are only set in root.
|
||||
*/
|
||||
export const HTTP_ROOT_INTERCEPTOR_FNS = new InjectionToken<readonly HttpInterceptorFn[]>(
|
||||
typeof ngDevMode !== undefined && ngDevMode ? 'HTTP_ROOT_INTERCEPTOR_FNS' : '',
|
||||
typeof ngDevMode !== 'undefined' && ngDevMode ? 'HTTP_ROOT_INTERCEPTOR_FNS' : '',
|
||||
);
|
||||
|
||||
// TODO(atscott): We need a larger discussion about stability and what should contribute to stability.
|
||||
// Should the whole interceptor chain contribute to stability or just the backend request #55075?
|
||||
// Should HttpClient contribute to stability automatically at all?
|
||||
export const REQUESTS_CONTRIBUTE_TO_STABILITY = new InjectionToken<boolean>(
|
||||
typeof ngDevMode !== undefined && ngDevMode ? 'REQUESTS_CONTRIBUTE_TO_STABILITY' : '',
|
||||
typeof ngDevMode !== 'undefined' && ngDevMode ? 'REQUESTS_CONTRIBUTE_TO_STABILITY' : '',
|
||||
{providedIn: 'root', factory: () => true},
|
||||
);
|
||||
|
||||
|
|
|
|||
|
|
@ -156,7 +156,7 @@ export function withInterceptors(
|
|||
}
|
||||
|
||||
const LEGACY_INTERCEPTOR_FN = new InjectionToken<HttpInterceptorFn>(
|
||||
typeof ngDevMode !== undefined && ngDevMode ? 'LEGACY_INTERCEPTOR_FN' : '',
|
||||
typeof ngDevMode !== 'undefined' && ngDevMode ? 'LEGACY_INTERCEPTOR_FN' : '',
|
||||
);
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -81,7 +81,7 @@ export type HttpTransferCacheOptions = {
|
|||
* @publicApi
|
||||
*/
|
||||
export const HTTP_TRANSFER_CACHE_ORIGIN_MAP = new InjectionToken<Record<string, string>>(
|
||||
typeof ngDevMode !== undefined && ngDevMode ? 'HTTP_TRANSFER_CACHE_ORIGIN_MAP' : '',
|
||||
typeof ngDevMode !== 'undefined' && ngDevMode ? 'HTTP_TRANSFER_CACHE_ORIGIN_MAP' : '',
|
||||
);
|
||||
|
||||
/**
|
||||
|
|
@ -115,7 +115,7 @@ interface CacheOptions extends HttpTransferCacheOptions {
|
|||
}
|
||||
|
||||
const CACHE_OPTIONS = new InjectionToken<CacheOptions>(
|
||||
typeof ngDevMode !== undefined && ngDevMode ? 'HTTP_TRANSFER_STATE_CACHE_OPTIONS' : '',
|
||||
typeof ngDevMode !== 'undefined' && ngDevMode ? 'HTTP_TRANSFER_STATE_CACHE_OPTIONS' : '',
|
||||
);
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ import {HttpRequest} from './request';
|
|||
import {HttpEvent} from './response';
|
||||
|
||||
export const XSRF_ENABLED = new InjectionToken<boolean>(
|
||||
typeof ngDevMode !== undefined && ngDevMode ? 'XSRF_ENABLED' : '',
|
||||
typeof ngDevMode !== 'undefined' && ngDevMode ? 'XSRF_ENABLED' : '',
|
||||
{
|
||||
factory: () => true,
|
||||
},
|
||||
|
|
@ -30,7 +30,7 @@ export const XSRF_ENABLED = new InjectionToken<boolean>(
|
|||
|
||||
export const XSRF_DEFAULT_COOKIE_NAME = 'XSRF-TOKEN';
|
||||
export const XSRF_COOKIE_NAME = new InjectionToken<string>(
|
||||
typeof ngDevMode !== undefined && ngDevMode ? 'XSRF_COOKIE_NAME' : '',
|
||||
typeof ngDevMode !== 'undefined' && ngDevMode ? 'XSRF_COOKIE_NAME' : '',
|
||||
{
|
||||
providedIn: 'root',
|
||||
factory: () => XSRF_DEFAULT_COOKIE_NAME,
|
||||
|
|
@ -39,7 +39,7 @@ export const XSRF_COOKIE_NAME = new InjectionToken<string>(
|
|||
|
||||
export const XSRF_DEFAULT_HEADER_NAME = 'X-XSRF-TOKEN';
|
||||
export const XSRF_HEADER_NAME = new InjectionToken<string>(
|
||||
typeof ngDevMode !== undefined && ngDevMode ? 'XSRF_HEADER_NAME' : '',
|
||||
typeof ngDevMode !== 'undefined' && ngDevMode ? 'XSRF_HEADER_NAME' : '',
|
||||
{
|
||||
providedIn: 'root',
|
||||
factory: () => XSRF_DEFAULT_HEADER_NAME,
|
||||
|
|
|
|||
|
|
@ -71,7 +71,7 @@ export type ImageLoaderInfo = {
|
|||
* @publicApi
|
||||
*/
|
||||
export const IMAGE_LOADER = new InjectionToken<ImageLoader>(
|
||||
typeof ngDevMode !== undefined && ngDevMode ? 'ImageLoader' : '',
|
||||
typeof ngDevMode !== 'undefined' && ngDevMode ? 'ImageLoader' : '',
|
||||
{
|
||||
factory: () => noopImageLoader,
|
||||
},
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@ const INTERNAL_PRECONNECT_CHECK_BLOCKLIST = new Set(['localhost', '127.0.0.1', '
|
|||
* @publicApi
|
||||
*/
|
||||
export const PRECONNECT_CHECK_BLOCKLIST = new InjectionToken<Array<string | string[]>>(
|
||||
typeof ngDevMode !== undefined && ngDevMode ? 'PRECONNECT_CHECK_BLOCKLIST' : '',
|
||||
typeof ngDevMode !== 'undefined' && ngDevMode ? 'PRECONNECT_CHECK_BLOCKLIST' : '',
|
||||
);
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -76,7 +76,7 @@ export abstract class LocationStrategy {
|
|||
* @publicApi
|
||||
*/
|
||||
export const APP_BASE_HREF = new InjectionToken<string>(
|
||||
typeof ngDevMode !== undefined && ngDevMode ? 'appBaseHref' : '',
|
||||
typeof ngDevMode !== 'undefined' && ngDevMode ? 'appBaseHref' : '',
|
||||
);
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -73,7 +73,7 @@ export abstract class PlatformLocation {
|
|||
* @publicApi
|
||||
*/
|
||||
export const LOCATION_INITIALIZED = new InjectionToken<Promise<any>>(
|
||||
typeof ngDevMode !== undefined && ngDevMode ? 'Location Initialized' : '',
|
||||
typeof ngDevMode !== 'undefined' && ngDevMode ? 'Location Initialized' : '',
|
||||
);
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ import {invalidPipeArgumentError} from './invalid_pipe_argument_error';
|
|||
* @deprecated use DATE_PIPE_DEFAULT_OPTIONS token to configure DatePipe
|
||||
*/
|
||||
export const DATE_PIPE_DEFAULT_TIMEZONE = new InjectionToken<string>(
|
||||
typeof ngDevMode !== undefined && ngDevMode ? 'DATE_PIPE_DEFAULT_TIMEZONE' : '',
|
||||
typeof ngDevMode !== 'undefined' && ngDevMode ? 'DATE_PIPE_DEFAULT_TIMEZONE' : '',
|
||||
);
|
||||
|
||||
/**
|
||||
|
|
@ -55,7 +55,7 @@ export const DATE_PIPE_DEFAULT_TIMEZONE = new InjectionToken<string>(
|
|||
* ```
|
||||
*/
|
||||
export const DATE_PIPE_DEFAULT_OPTIONS = new InjectionToken<DatePipeConfig>(
|
||||
typeof ngDevMode !== undefined && ngDevMode ? 'DATE_PIPE_DEFAULT_OPTIONS' : '',
|
||||
typeof ngDevMode !== 'undefined' && ngDevMode ? 'DATE_PIPE_DEFAULT_OPTIONS' : '',
|
||||
);
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -56,11 +56,11 @@ export interface LocationUpgradeConfig {
|
|||
* @publicApi
|
||||
*/
|
||||
export const LOCATION_UPGRADE_CONFIGURATION = new InjectionToken<LocationUpgradeConfig>(
|
||||
typeof ngDevMode !== undefined && ngDevMode ? 'LOCATION_UPGRADE_CONFIGURATION' : '',
|
||||
typeof ngDevMode !== 'undefined' && ngDevMode ? 'LOCATION_UPGRADE_CONFIGURATION' : '',
|
||||
);
|
||||
|
||||
const APP_BASE_HREF_RESOLVED = new InjectionToken<string>(
|
||||
typeof ngDevMode !== undefined && ngDevMode ? 'APP_BASE_HREF_RESOLVED' : '',
|
||||
typeof ngDevMode !== 'undefined' && ngDevMode ? 'APP_BASE_HREF_RESOLVED' : '',
|
||||
);
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ import {RuntimeError, RuntimeErrorCode} from '../errors';
|
|||
* @publicApi
|
||||
*/
|
||||
export const APP_ID = new InjectionToken<string>(
|
||||
typeof ngDevMode !== undefined && ngDevMode ? 'AppId' : '',
|
||||
typeof ngDevMode !== 'undefined' && ngDevMode ? 'AppId' : '',
|
||||
{
|
||||
factory: () => DEFAULT_APP_ID,
|
||||
},
|
||||
|
|
@ -79,7 +79,7 @@ export const validAppIdInitializer: StaticProvider = {
|
|||
* @publicApi
|
||||
*/
|
||||
export const PLATFORM_INITIALIZER = new InjectionToken<ReadonlyArray<() => void>>(
|
||||
typeof ngDevMode !== undefined && ngDevMode ? 'Platform Initializer' : '',
|
||||
typeof ngDevMode !== 'undefined' && ngDevMode ? 'Platform Initializer' : '',
|
||||
);
|
||||
|
||||
/**
|
||||
|
|
@ -87,7 +87,7 @@ export const PLATFORM_INITIALIZER = new InjectionToken<ReadonlyArray<() => void>
|
|||
* @publicApi
|
||||
*/
|
||||
export const PLATFORM_ID = new InjectionToken<Object>(
|
||||
typeof ngDevMode !== undefined && ngDevMode ? 'Platform ID' : '',
|
||||
typeof ngDevMode !== 'undefined' && ngDevMode ? 'Platform ID' : '',
|
||||
{
|
||||
providedIn: 'platform',
|
||||
factory: () => 'unknown', // set a default platform name, when none set explicitly
|
||||
|
|
@ -104,7 +104,7 @@ export const PLATFORM_ID = new InjectionToken<Object>(
|
|||
* @publicApi
|
||||
*/
|
||||
export const ANIMATION_MODULE_TYPE = new InjectionToken<'NoopAnimations' | 'BrowserAnimations'>(
|
||||
typeof ngDevMode !== undefined && ngDevMode ? 'AnimationModuleType' : '',
|
||||
typeof ngDevMode !== 'undefined' && ngDevMode ? 'AnimationModuleType' : '',
|
||||
);
|
||||
|
||||
// TODO(crisbeto): link to CSP guide here.
|
||||
|
|
@ -118,7 +118,7 @@ export const ANIMATION_MODULE_TYPE = new InjectionToken<'NoopAnimations' | 'Brow
|
|||
* @publicApi
|
||||
*/
|
||||
export const CSP_NONCE = new InjectionToken<string | null>(
|
||||
typeof ngDevMode !== undefined && ngDevMode ? 'CSP nonce' : '',
|
||||
typeof ngDevMode !== 'undefined' && ngDevMode ? 'CSP nonce' : '',
|
||||
{
|
||||
factory: () => {
|
||||
// Ideally we wouldn't have to use `querySelector` here since we know that the nonce will be on
|
||||
|
|
@ -184,7 +184,7 @@ export const IMAGE_CONFIG_DEFAULTS: ImageConfig = {
|
|||
* @publicApi
|
||||
*/
|
||||
export const IMAGE_CONFIG = new InjectionToken<ImageConfig>(
|
||||
typeof ngDevMode !== undefined && ngDevMode ? 'ImageConfig' : '',
|
||||
typeof ngDevMode !== 'undefined' && ngDevMode ? 'ImageConfig' : '',
|
||||
{
|
||||
factory: () => IMAGE_CONFIG_DEFAULTS,
|
||||
},
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ export interface TracingSnapshot {
|
|||
* Injection token for a `TracingService`, optionally provided.
|
||||
*/
|
||||
export const TracingService = new InjectionToken<TracingService<TracingSnapshot>>(
|
||||
typeof ngDevMode !== undefined && ngDevMode ? 'TracingService' : '',
|
||||
typeof ngDevMode !== 'undefined' && ngDevMode ? 'TracingService' : '',
|
||||
);
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -11,5 +11,5 @@ import {InjectionToken} from '../di';
|
|||
export const USE_EXHAUSTIVE_CHECK_NO_CHANGES_DEFAULT = false;
|
||||
|
||||
export const UseExhaustiveCheckNoChanges = new InjectionToken<boolean>(
|
||||
typeof ngDevMode !== undefined && ngDevMode ? 'exhaustive checkNoChanges' : '',
|
||||
typeof ngDevMode !== 'undefined' && ngDevMode ? 'exhaustive checkNoChanges' : '',
|
||||
);
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ import type {PromiseWithResolvers} from '../util/promise_with_resolvers';
|
|||
* in a tree-shakable way.
|
||||
*/
|
||||
export const DEHYDRATED_BLOCK_REGISTRY = new InjectionToken<DehydratedBlockRegistry>(
|
||||
typeof ngDevMode !== undefined && ngDevMode ? 'DEHYDRATED_BLOCK_REGISTRY' : '',
|
||||
typeof ngDevMode !== 'undefined' && ngDevMode ? 'DEHYDRATED_BLOCK_REGISTRY' : '',
|
||||
);
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -72,7 +72,7 @@ export const DEFER_BLOCK_DEPENDENCY_INTERCEPTOR =
|
|||
* **INTERNAL**, token used for configuring defer block behavior.
|
||||
*/
|
||||
export const DEFER_BLOCK_CONFIG = new InjectionToken<DeferBlockConfig>(
|
||||
typeof ngDevMode !== undefined && ngDevMode ? 'DEFER_BLOCK_CONFIG' : '',
|
||||
typeof ngDevMode !== 'undefined' && ngDevMode ? 'DEFER_BLOCK_CONFIG' : '',
|
||||
);
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ export const HOST_TAG_NAME: InjectionToken<string> = /* @__PURE__ */ (() => {
|
|||
// the top level instead, the mutation would look like a side effect,
|
||||
// forcing the bundler to keep it even when unused.
|
||||
const HOST_TAG_NAME_TOKEN = new InjectionToken<string>(
|
||||
typeof ngDevMode !== undefined && ngDevMode ? 'HOST_TAG_NAME' : '',
|
||||
typeof ngDevMode !== 'undefined' && ngDevMode ? 'HOST_TAG_NAME' : '',
|
||||
);
|
||||
|
||||
// HOST_TAG_NAME should be resolved at the current node, similar to e.g. ElementRef,
|
||||
|
|
|
|||
|
|
@ -22,5 +22,5 @@ import {InjectionToken} from './injection_token';
|
|||
* @publicApi
|
||||
*/
|
||||
export const ENVIRONMENT_INITIALIZER = new InjectionToken<ReadonlyArray<() => void>>(
|
||||
typeof ngDevMode !== undefined && ngDevMode ? 'ENVIRONMENT_INITIALIZER' : '',
|
||||
typeof ngDevMode !== 'undefined' && ngDevMode ? 'ENVIRONMENT_INITIALIZER' : '',
|
||||
);
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ import {InjectorMarkers} from './injector_marker';
|
|||
* @publicApi
|
||||
*/
|
||||
export const INJECTOR = new InjectionToken<Injector>(
|
||||
typeof ngDevMode !== undefined && ngDevMode ? 'INJECTOR' : '',
|
||||
typeof ngDevMode !== 'undefined' && ngDevMode ? 'INJECTOR' : '',
|
||||
// Disable tslint because this is const enum which gets inlined not top level prop access.
|
||||
// tslint:disable-next-line: no-toplevel-property-access
|
||||
InjectorMarkers.Injector as any, // Special value used by Ivy to identify `Injector`.
|
||||
|
|
|
|||
|
|
@ -11,5 +11,5 @@ import {Type} from '../interface/type';
|
|||
import {InjectionToken} from './injection_token';
|
||||
|
||||
export const INJECTOR_DEF_TYPES = new InjectionToken<ReadonlyArray<Type<unknown>>>(
|
||||
typeof ngDevMode !== undefined && ngDevMode ? 'INJECTOR_DEF_TYPES' : '',
|
||||
typeof ngDevMode !== 'undefined' && ngDevMode ? 'INJECTOR_DEF_TYPES' : '',
|
||||
);
|
||||
|
|
|
|||
|
|
@ -16,5 +16,5 @@ export type InjectorScope = 'root' | 'platform' | 'environment';
|
|||
* they are provided in the root scope.
|
||||
*/
|
||||
export const INJECTOR_SCOPE = new InjectionToken<InjectorScope | null>(
|
||||
typeof ngDevMode !== undefined && ngDevMode ? 'Set Injector scope.' : '',
|
||||
typeof ngDevMode !== 'undefined' && ngDevMode ? 'Set Injector scope.' : '',
|
||||
);
|
||||
|
|
|
|||
|
|
@ -18,5 +18,5 @@ import {InjectionToken} from './di';
|
|||
* @publicApi
|
||||
*/
|
||||
export const DOCUMENT = new InjectionToken<Document>(
|
||||
typeof ngDevMode !== undefined && ngDevMode ? 'DocumentToken' : '',
|
||||
typeof ngDevMode !== 'undefined' && ngDevMode ? 'DocumentToken' : '',
|
||||
);
|
||||
|
|
|
|||
|
|
@ -106,7 +106,7 @@ export const errorHandlerEnvironmentInitializer = {
|
|||
};
|
||||
|
||||
const globalErrorListeners = new InjectionToken<void>(
|
||||
typeof ngDevMode !== undefined && ngDevMode ? 'GlobalErrorListeners' : '',
|
||||
typeof ngDevMode !== 'undefined' && ngDevMode ? 'GlobalErrorListeners' : '',
|
||||
{
|
||||
factory: () => {
|
||||
if (typeof ngServerMode !== 'undefined' && ngServerMode) {
|
||||
|
|
|
|||
|
|
@ -95,7 +95,7 @@ export interface EventContractDetails {
|
|||
}
|
||||
|
||||
export const JSACTION_EVENT_CONTRACT = new InjectionToken<EventContractDetails>(
|
||||
typeof ngDevMode !== undefined && ngDevMode ? 'EVENT_CONTRACT_DETAILS' : '',
|
||||
typeof ngDevMode !== 'undefined' && ngDevMode ? 'EVENT_CONTRACT_DETAILS' : '',
|
||||
{
|
||||
factory: () => ({}),
|
||||
},
|
||||
|
|
|
|||
|
|
@ -61,7 +61,7 @@ export const IS_INCREMENTAL_HYDRATION_ENABLED = new InjectionToken<boolean>(
|
|||
* A map of DOM elements with `jsaction` attributes grouped by action names.
|
||||
*/
|
||||
export const JSACTION_BLOCK_ELEMENT_MAP = new InjectionToken<Map<string, Set<Element>>>(
|
||||
typeof ngDevMode !== undefined && ngDevMode ? 'JSACTION_BLOCK_ELEMENT_MAP' : '',
|
||||
typeof ngDevMode !== 'undefined' && ngDevMode ? 'JSACTION_BLOCK_ELEMENT_MAP' : '',
|
||||
{
|
||||
factory: () => new Map<string, Set<Element>>(),
|
||||
},
|
||||
|
|
|
|||
|
|
@ -79,7 +79,7 @@ export function getGlobalLocale(): string {
|
|||
* @publicApi
|
||||
*/
|
||||
export const LOCALE_ID: InjectionToken<string> = new InjectionToken(
|
||||
typeof ngDevMode !== undefined && ngDevMode ? 'LocaleId' : '',
|
||||
typeof ngDevMode !== 'undefined' && ngDevMode ? 'LocaleId' : '',
|
||||
{
|
||||
factory: () => inject(LOCALE_ID, {optional: true, skipSelf: true}) || getGlobalLocale(),
|
||||
},
|
||||
|
|
@ -129,7 +129,7 @@ export const LOCALE_ID: InjectionToken<string> = new InjectionToken(
|
|||
* @publicApi
|
||||
*/
|
||||
export const DEFAULT_CURRENCY_CODE = new InjectionToken<string>(
|
||||
typeof ngDevMode !== undefined && ngDevMode ? 'DefaultCurrencyCode' : '',
|
||||
typeof ngDevMode !== 'undefined' && ngDevMode ? 'DefaultCurrencyCode' : '',
|
||||
{
|
||||
factory: () => USD_CURRENCY_CODE,
|
||||
},
|
||||
|
|
@ -169,7 +169,7 @@ export const DEFAULT_CURRENCY_CODE = new InjectionToken<string>(
|
|||
* @publicApi
|
||||
*/
|
||||
export const TRANSLATIONS = new InjectionToken<string>(
|
||||
typeof ngDevMode !== undefined && ngDevMode ? 'Translations' : '',
|
||||
typeof ngDevMode !== 'undefined' && ngDevMode ? 'Translations' : '',
|
||||
);
|
||||
|
||||
/**
|
||||
|
|
@ -203,7 +203,7 @@ export const TRANSLATIONS = new InjectionToken<string>(
|
|||
* @publicApi
|
||||
*/
|
||||
export const TRANSLATIONS_FORMAT = new InjectionToken<string>(
|
||||
typeof ngDevMode !== undefined && ngDevMode ? 'TranslationsFormat' : '',
|
||||
typeof ngDevMode !== 'undefined' && ngDevMode ? 'TranslationsFormat' : '',
|
||||
);
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -126,7 +126,7 @@ export type CompilerOptions = {
|
|||
* @publicApi
|
||||
*/
|
||||
export const COMPILER_OPTIONS = new InjectionToken<CompilerOptions[]>(
|
||||
typeof ngDevMode !== undefined && ngDevMode ? 'compilerOptions' : '',
|
||||
typeof ngDevMode !== 'undefined' && ngDevMode ? 'compilerOptions' : '',
|
||||
);
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@ import {PendingTasksInternal} from '../pending_tasks_internal';
|
|||
* from component rendering.
|
||||
*/
|
||||
export const ENABLE_ROOT_COMPONENT_BOOTSTRAP = new InjectionToken<boolean>(
|
||||
typeof ngDevMode !== undefined && ngDevMode ? 'ENABLE_ROOT_COMPONENT_BOOTSTRAP' : '',
|
||||
typeof ngDevMode !== 'undefined' && ngDevMode ? 'ENABLE_ROOT_COMPONENT_BOOTSTRAP' : '',
|
||||
);
|
||||
|
||||
export interface BootstrapConfig {
|
||||
|
|
|
|||
|
|
@ -15,5 +15,5 @@ import {InjectionToken} from '../di';
|
|||
* entire class tree-shakeable.
|
||||
*/
|
||||
export const PLATFORM_DESTROY_LISTENERS = new InjectionToken<Set<VoidFunction>>(
|
||||
typeof ngDevMode !== undefined && ngDevMode ? 'PlatformDestroyListeners' : '',
|
||||
typeof ngDevMode !== 'undefined' && ngDevMode ? 'PlatformDestroyListeners' : '',
|
||||
);
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ import type {FieldTree} from './types';
|
|||
* @experimental 21.0.0
|
||||
*/
|
||||
export const FIELD = new InjectionToken<Field<unknown>>(
|
||||
typeof ngDevMode !== undefined && ngDevMode ? 'FIELD' : '',
|
||||
typeof ngDevMode !== 'undefined' && ngDevMode ? 'FIELD' : '',
|
||||
);
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -212,5 +212,5 @@ export class BuiltInControlValueAccessor extends BaseControlValueAccessor {}
|
|||
* @publicApi
|
||||
*/
|
||||
export const NG_VALUE_ACCESSOR = new InjectionToken<ReadonlyArray<ControlValueAccessor>>(
|
||||
typeof ngDevMode !== undefined && ngDevMode ? 'NgValueAccessor' : '',
|
||||
typeof ngDevMode !== 'undefined' && ngDevMode ? 'NgValueAccessor' : '',
|
||||
);
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@ function _isAndroid(): boolean {
|
|||
* @publicApi
|
||||
*/
|
||||
export const COMPOSITION_BUFFER_MODE = new InjectionToken<boolean>(
|
||||
typeof ngDevMode !== undefined && ngDevMode ? 'CompositionEventMode' : '',
|
||||
typeof ngDevMode !== 'undefined' && ngDevMode ? 'CompositionEventMode' : '',
|
||||
);
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ import {AsyncValidator, AsyncValidatorFn, Validator, ValidatorFn} from '../valid
|
|||
* Token to provide to turn off the ngModel warning on formControl and formControlName.
|
||||
*/
|
||||
export const NG_MODEL_WITH_FORM_CONTROL_WARNING = new InjectionToken(
|
||||
typeof ngDevMode !== undefined && ngDevMode ? 'NgModelWithFormControlWarning' : '',
|
||||
typeof ngDevMode !== 'undefined' && ngDevMode ? 'NgModelWithFormControlWarning' : '',
|
||||
);
|
||||
|
||||
const formControlBinding: Provider = {
|
||||
|
|
|
|||
|
|
@ -79,7 +79,7 @@ function lengthOrSize(value: unknown): number | null {
|
|||
* @publicApi
|
||||
*/
|
||||
export const NG_VALIDATORS = new InjectionToken<ReadonlyArray<Validator | Function>>(
|
||||
typeof ngDevMode !== undefined && ngDevMode ? 'NgValidators' : '',
|
||||
typeof ngDevMode !== 'undefined' && ngDevMode ? 'NgValidators' : '',
|
||||
);
|
||||
|
||||
/**
|
||||
|
|
@ -114,7 +114,7 @@ export const NG_VALIDATORS = new InjectionToken<ReadonlyArray<Validator | Functi
|
|||
* @publicApi
|
||||
*/
|
||||
export const NG_ASYNC_VALIDATORS = new InjectionToken<ReadonlyArray<Validator | Function>>(
|
||||
typeof ngDevMode !== undefined && ngDevMode ? 'NgAsyncValidators' : '',
|
||||
typeof ngDevMode !== 'undefined' && ngDevMode ? 'NgAsyncValidators' : '',
|
||||
);
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -324,5 +324,5 @@ export class DynamicDelegationRenderer implements Renderer2 {
|
|||
* Private token for investigation purposes
|
||||
*/
|
||||
export const ɵASYNC_ANIMATION_LOADING_SCHEDULER_FN = new InjectionToken<<T>(loadFn: () => T) => T>(
|
||||
typeof ngDevMode !== undefined && ngDevMode ? 'async_animation_loading_scheduler_fn' : '',
|
||||
typeof ngDevMode !== 'undefined' && ngDevMode ? 'async_animation_loading_scheduler_fn' : '',
|
||||
);
|
||||
|
|
|
|||
|
|
@ -63,7 +63,7 @@ const REMOVE_STYLES_ON_COMPONENT_DESTROY_DEFAULT = true;
|
|||
* @publicApi
|
||||
*/
|
||||
export const REMOVE_STYLES_ON_COMPONENT_DESTROY = new InjectionToken<boolean>(
|
||||
typeof ngDevMode !== undefined && ngDevMode ? 'RemoveStylesOnCompDestroy' : '',
|
||||
typeof ngDevMode !== 'undefined' && ngDevMode ? 'RemoveStylesOnCompDestroy' : '',
|
||||
{
|
||||
factory: () => REMOVE_STYLES_ON_COMPONENT_DESTROY_DEFAULT,
|
||||
},
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ import {DomEventsPlugin} from './dom_events';
|
|||
* @publicApi
|
||||
*/
|
||||
export const EVENT_MANAGER_PLUGINS = new InjectionToken<EventManagerPlugin[]>(
|
||||
typeof ngDevMode !== undefined && ngDevMode ? 'EventManagerPlugins' : '',
|
||||
typeof ngDevMode !== 'undefined' && ngDevMode ? 'EventManagerPlugins' : '',
|
||||
);
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -58,7 +58,7 @@ import {PRIMARY_OUTLET} from '../shared';
|
|||
* @see [Page routerOutletData](guide/routing/show-routes-with-outlets#passing-contextual-data-to-routed-components)
|
||||
*/
|
||||
export const ROUTER_OUTLET_DATA = new InjectionToken<Signal<unknown | undefined>>(
|
||||
typeof ngDevMode !== undefined && ngDevMode ? 'RouterOutlet data' : '',
|
||||
typeof ngDevMode !== 'undefined' && ngDevMode ? 'RouterOutlet data' : '',
|
||||
);
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ import {wrapIntoPromise} from './utils/collection';
|
|||
* @publicApi
|
||||
*/
|
||||
export const ROUTES = new InjectionToken<Route[][]>(
|
||||
typeof ngDevMode !== undefined && ngDevMode ? 'ROUTES' : '',
|
||||
typeof ngDevMode !== 'undefined' && ngDevMode ? 'ROUTES' : '',
|
||||
);
|
||||
|
||||
@Injectable({providedIn: 'root'})
|
||||
|
|
|
|||
|
|
@ -12,11 +12,11 @@ import {afterNextRender, InjectionToken, Injector, runInInjectionContext} from '
|
|||
import {ActivatedRouteSnapshot} from '../router_state';
|
||||
|
||||
export const CREATE_VIEW_TRANSITION = new InjectionToken<typeof createViewTransition>(
|
||||
typeof ngDevMode !== undefined && ngDevMode ? 'view transition helper' : '',
|
||||
typeof ngDevMode !== 'undefined' && ngDevMode ? 'view transition helper' : '',
|
||||
);
|
||||
export const VIEW_TRANSITION_OPTIONS = new InjectionToken<
|
||||
ViewTransitionsFeatureOptions & {skipNextTransition: boolean}
|
||||
>(typeof ngDevMode !== undefined && ngDevMode ? 'view transition options' : '');
|
||||
>(typeof ngDevMode !== 'undefined' && ngDevMode ? 'view transition options' : '');
|
||||
|
||||
/**
|
||||
* Options to configure the View Transitions integration in the Router.
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ import {SwUpdate} from './update';
|
|||
import {RuntimeErrorCode} from './errors';
|
||||
|
||||
export const SCRIPT = new InjectionToken<string>(
|
||||
typeof ngDevMode !== undefined && ngDevMode ? 'NGSW_REGISTER_SCRIPT' : '',
|
||||
typeof ngDevMode !== 'undefined' && ngDevMode ? 'NGSW_REGISTER_SCRIPT' : '',
|
||||
);
|
||||
|
||||
export function ngswAppInitializer(): void {
|
||||
|
|
|
|||
Loading…
Reference in a new issue