diff --git a/packages/core/src/core_render3_private_export.ts b/packages/core/src/core_render3_private_export.ts index 3afc6c83d4..9a94298241 100644 --- a/packages/core/src/core_render3_private_export.ts +++ b/packages/core/src/core_render3_private_export.ts @@ -253,8 +253,5 @@ export { publishGlobalUtil as ɵpublishGlobalUtil, publishDefaultGlobalUtils as ɵpublishDefaultGlobalUtils } from './render3/global_utils'; -export { - SWITCH_INJECTOR_FACTORY__POST_R3__ as ɵSWITCH_INJECTOR_FACTORY__POST_R3__, -} from './di/injector'; // clang-format on diff --git a/packages/core/src/di.ts b/packages/core/src/di.ts index bdbf20e97a..d9017e84b9 100644 --- a/packages/core/src/di.ts +++ b/packages/core/src/di.ts @@ -7,20 +7,20 @@ */ /** - * @module - * @description - * The `di` module provides dependency injection container services. + * This file should not be necessary because node resolution should just default to `./di/index`! + * + * However it does not seem to work and it breaks: + * - //packages/animations/browser/test:test_web_chromium-local + * - //packages/compiler-cli/test:extract_i18n + * - //packages/compiler-cli/test:ngc + * - //packages/compiler-cli/test:perform_watch + * - //packages/compiler-cli/test/diagnostics:check_types + * - //packages/compiler-cli/test/transformers:test + * - //packages/compiler/test:test + * - //tools/public_api_guard:core_api + * + * Remove this file once the above is solved or wait until `ngc` is deleted and then it should be + * safe to delete this file. */ -export * from './di/metadata'; -export {InjectableType, InjectorType, defineInjectable, defineInjector} from './di/interface/defs'; -export {forwardRef, resolveForwardRef, ForwardRefFn} from './di/forward_ref'; -export {Injectable, InjectableDecorator, InjectableProvider} from './di/injectable'; -export {INJECTOR, Injector} from './di/injector'; -export {inject, InjectFlags} from './di/injector_compatibility'; -export {ReflectiveInjector} from './di/reflective_injector'; -export {StaticProvider, ValueProvider, ConstructorSansProvider, ExistingProvider, FactoryProvider, Provider, TypeProvider, ClassProvider} from './di/interface/provider'; -export {createInjector} from './di/r3_injector'; -export {ResolvedReflectiveFactory, ResolvedReflectiveProvider} from './di/reflective_provider'; -export {ReflectiveKey} from './di/reflective_key'; -export {InjectionToken} from './di/injection_token'; +export * from './di/index'; diff --git a/packages/core/src/di/index.ts b/packages/core/src/di/index.ts new file mode 100644 index 0000000000..b63fb44071 --- /dev/null +++ b/packages/core/src/di/index.ts @@ -0,0 +1,27 @@ +/** + * @license + * Copyright Google Inc. All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.io/license + */ + +/** + * @module + * @description + * The `di` module provides dependency injection container services. + */ + +export * from './metadata'; +export {InjectFlags} from './interface/injector'; +export {defineInjectable, defineInjector, InjectableType, InjectorType} from './interface/defs'; +export {forwardRef, resolveForwardRef, ForwardRefFn} from './forward_ref'; +export {Injectable, InjectableDecorator, InjectableProvider} from './injectable'; +export {INJECTOR, Injector} from './injector'; +export {inject} from './injector_compatibility'; +export {ReflectiveInjector} from './reflective_injector'; +export {StaticProvider, ValueProvider, ConstructorSansProvider, ExistingProvider, FactoryProvider, Provider, TypeProvider, ClassProvider} from './interface/provider'; +export {createInjector} from './r3_injector'; +export {ResolvedReflectiveFactory, ResolvedReflectiveProvider} from './reflective_provider'; +export {ReflectiveKey} from './reflective_key'; +export {InjectionToken} from './injection_token'; diff --git a/packages/core/src/di/injectable.ts b/packages/core/src/di/injectable.ts index 4e55b67dc4..131cfad4fc 100644 --- a/packages/core/src/di/injectable.ts +++ b/packages/core/src/di/injectable.ts @@ -10,8 +10,7 @@ import {Type} from '../interface/type'; import {compileInjectable as render3CompileInjectable} from '../render3/jit/injectable'; import {TypeDecorator, makeDecorator} from '../util/decorators'; -import {InjectableDef, InjectableType, defineInjectable, getInjectableDef} from './interface/defs'; -import {ClassSansProvider, ConstructorSansProvider, ExistingSansProvider, FactorySansProvider, StaticClassSansProvider, ValueSansProvider} from './interface/provider'; +import {ClassSansProvider, ConstructorSansProvider, ExistingSansProvider, FactorySansProvider, InjectableDef, InjectableType, StaticClassSansProvider, ValueSansProvider, defineInjectable, getInjectableDef} from './interface'; import {convertInjectableProviderToFactory} from './util'; diff --git a/packages/core/src/di/injection_token.ts b/packages/core/src/di/injection_token.ts index 3eb1966753..67e82b71ea 100644 --- a/packages/core/src/di/injection_token.ts +++ b/packages/core/src/di/injection_token.ts @@ -60,13 +60,17 @@ export class InjectionToken { providedIn?: Type| 'root' | null, factory: () => T }) { - if (options !== undefined) { + this.ngInjectableDef = undefined; + if (typeof options == 'number') { + // This is a special hack to assign __NG_ELEMENT_ID__ to this instance. + // __NG_ELEMENT_ID__ is Used by Ivy to determine bloom filter id. + // We are using it to assign `-1` which is used to identify `Injector`. + (this as any).__NG_ELEMENT_ID__ = options; + } else if (options !== undefined) { this.ngInjectableDef = defineInjectable({ providedIn: options.providedIn || 'root', factory: options.factory, }); - } else { - this.ngInjectableDef = undefined; } } diff --git a/packages/core/src/di/injector.ts b/packages/core/src/di/injector.ts index f15568fb25..22b2b28b2c 100644 --- a/packages/core/src/di/injector.ts +++ b/packages/core/src/di/injector.ts @@ -7,16 +7,13 @@ */ import {Type} from '../interface/type'; -import {injectInjector} from '../render3/di'; -import {noop} from '../util/noop'; import {getClosureSafeProperty} from '../util/property'; import {stringify} from '../util/stringify'; import {resolveForwardRef} from './forward_ref'; import {InjectionToken} from './injection_token'; -import {InjectFlags, inject} from './injector_compatibility'; -import {defineInjectable} from './interface/defs'; -import {ConstructorProvider, ExistingProvider, FactoryProvider, StaticClassProvider, StaticProvider, ValueProvider} from './interface/provider'; +import {inject} from './injector_compatibility'; +import {ConstructorProvider, ExistingProvider, FactoryProvider, InjectFlags, StaticClassProvider, StaticProvider, ValueProvider, defineInjectable} from './interface'; import {Inject, Optional, Self, SkipSelf} from './metadata'; export const SOURCE = '__source'; @@ -31,7 +28,10 @@ export const THROW_IF_NOT_FOUND = _THROW_IF_NOT_FOUND; * * @publicApi */ -export const INJECTOR = new InjectionToken('INJECTOR'); +export const INJECTOR = new InjectionToken( + 'INJECTOR', + -1 as any // `-1` is used by Ivy DI system as special value to recognize it as `Injector`. + ); export class NullInjector implements Injector { get(token: any, notFoundValue: any = _THROW_IF_NOT_FOUND): any { @@ -109,16 +109,13 @@ export abstract class Injector { factory: () => inject(INJECTOR), }); - /** @internal */ - /** @nocollapse */ - static __NG_ELEMENT_ID__: () => Injector = () => SWITCH_INJECTOR_FACTORY(); + /** + * @internal + * @nocollapse + */ + static __NG_ELEMENT_ID__ = -1; } -export const SWITCH_INJECTOR_FACTORY__POST_R3__ = function() { - return injectInjector(); -}; -const SWITCH_INJECTOR_FACTORY__PRE_R3__ = noop; -const SWITCH_INJECTOR_FACTORY: typeof injectInjector = SWITCH_INJECTOR_FACTORY__PRE_R3__; const IDENT = function(value: T): T { diff --git a/packages/core/src/di/injector_compatibility.ts b/packages/core/src/di/injector_compatibility.ts index c2b1db7116..0a2b2aca04 100644 --- a/packages/core/src/di/injector_compatibility.ts +++ b/packages/core/src/di/injector_compatibility.ts @@ -11,34 +11,10 @@ import {stringify} from '../util/stringify'; import {InjectionToken} from './injection_token'; import {Injector} from './injector'; -import {InjectableDef, getInjectableDef} from './interface/defs'; +import {InjectFlags, InjectableDef, getInjectableDef} from './interface'; import {Inject, Optional, Self, SkipSelf} from './metadata'; -/** - * Injection flags for DI. - * - * @publicApi - */ -export enum InjectFlags { - // TODO(alxhub): make this 'const' when ngc no longer writes exports of it into ngfactory files. - - Default = 0b0000, - - /** - * Specifies that an injector should retrieve a dependency from any injector until reaching the - * host element of the current component. (Only used with Element Injector) - */ - Host = 0b0001, - /** Don't descend into ancestors of the node requesting injection. */ - Self = 0b0010, - /** Skip the node that is requesting injection. */ - SkipSelf = 0b0100, - /** Inject `defaultValue` instead if token not found. */ - Optional = 0b1000, -} - - /** * Current injector value used by `inject`. diff --git a/packages/core/src/di/interface.ts b/packages/core/src/di/interface.ts new file mode 100644 index 0000000000..25dd59c37a --- /dev/null +++ b/packages/core/src/di/interface.ts @@ -0,0 +1,15 @@ +/** + * @license + * Copyright Google Inc. All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.io/license + */ + +/** + * This file should not be necessary because node resolution should just default to `./di/index`! + * + * However it does not seem to work and it breaks web tests. + */ + +export * from './interface/index'; diff --git a/packages/core/src/di/interface/index.ts b/packages/core/src/di/interface/index.ts new file mode 100644 index 0000000000..680be40252 --- /dev/null +++ b/packages/core/src/di/interface/index.ts @@ -0,0 +1,11 @@ +/** + * @license + * Copyright Google Inc. All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.io/license + */ + +export * from './injector'; +export * from './defs'; +export * from './provider'; diff --git a/packages/core/src/di/interface/injector.ts b/packages/core/src/di/interface/injector.ts new file mode 100644 index 0000000000..9d761c522d --- /dev/null +++ b/packages/core/src/di/interface/injector.ts @@ -0,0 +1,31 @@ +/** + * @license + * Copyright Google Inc. All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.io/license + */ + + +/** + * Injection flags for DI. + * + * @publicApi + */ +export enum InjectFlags { + // TODO(alxhub): make this 'const' when ngc no longer writes exports of it into ngfactory files. + + Default = 0b0000, + + /** + * Specifies that an injector should retrieve a dependency from any injector until reaching the + * host element of the current component. (Only used with Element Injector) + */ + Host = 0b0001, + /** Don't ascend to ancestors of the node requesting injection. */ + Self = 0b0010, + /** Skip the node that is requesting injection. */ + SkipSelf = 0b0100, + /** Inject `defaultValue` instead if token not found. */ + Optional = 0b1000, +} diff --git a/packages/core/src/di/metadata.ts b/packages/core/src/di/metadata.ts index ba9a4e5b22..3eafa2a332 100644 --- a/packages/core/src/di/metadata.ts +++ b/packages/core/src/di/metadata.ts @@ -6,12 +6,7 @@ * found in the LICENSE file at https://angular.io/license */ -import {Type} from '../interface/type'; -import {ReflectionCapabilities} from '../reflection/reflection_capabilities'; -import {makeDecorator, makeParamDecorator} from '../util/decorators'; -import {EMPTY_ARRAY} from '../view/util'; - -import {ClassSansProvider, ConstructorProvider, ConstructorSansProvider, ExistingProvider, ExistingSansProvider, FactoryProvider, FactorySansProvider, StaticClassProvider, StaticClassSansProvider, ValueProvider, ValueSansProvider} from './interface/provider'; +import {makeParamDecorator} from '../util/decorators'; diff --git a/packages/core/src/di/r3_injector.ts b/packages/core/src/di/r3_injector.ts index b24a5bfed4..bbf6f490e0 100644 --- a/packages/core/src/di/r3_injector.ts +++ b/packages/core/src/di/r3_injector.ts @@ -13,9 +13,8 @@ import {stringify} from '../util/stringify'; import {resolveForwardRef} from './forward_ref'; import {InjectionToken} from './injection_token'; import {INJECTOR, Injector, NullInjector, THROW_IF_NOT_FOUND, USE_VALUE} from './injector'; -import {InjectFlags, inject, injectArgs, setCurrentInjector} from './injector_compatibility'; -import {InjectableDef, InjectableType, InjectorType, InjectorTypeWithProviders, getInjectableDef, getInjectorDef} from './interface/defs'; -import {ClassProvider, ConstructorProvider, ExistingProvider, FactoryProvider, Provider, StaticClassProvider, StaticProvider, TypeProvider, ValueProvider} from './interface/provider'; +import {inject, injectArgs, setCurrentInjector} from './injector_compatibility'; +import {ClassProvider, ConstructorProvider, ExistingProvider, FactoryProvider, InjectFlags, InjectableDef, InjectableType, InjectorType, InjectorTypeWithProviders, Provider, StaticClassProvider, StaticProvider, TypeProvider, ValueProvider, getInjectableDef, getInjectorDef} from './interface'; import {APP_ROOT} from './scope'; diff --git a/packages/core/src/di/reflective_injector.ts b/packages/core/src/di/reflective_injector.ts index 8ce87b226f..76ee5b811d 100644 --- a/packages/core/src/di/reflective_injector.ts +++ b/packages/core/src/di/reflective_injector.ts @@ -7,7 +7,7 @@ */ import {Injector, THROW_IF_NOT_FOUND} from './injector'; -import {Provider} from './interface/provider'; +import {Provider} from './interface'; import {Self, SkipSelf} from './metadata'; import {cyclicDependencyError, instantiationError, noProviderError, outOfBoundsError} from './reflective_errors'; import {ReflectiveKey} from './reflective_key'; diff --git a/packages/core/src/di/reflective_provider.ts b/packages/core/src/di/reflective_provider.ts index f9a8c26e7b..28a4248f4c 100644 --- a/packages/core/src/di/reflective_provider.ts +++ b/packages/core/src/di/reflective_provider.ts @@ -11,7 +11,7 @@ import {reflector} from '../reflection/reflection'; import {resolveForwardRef} from './forward_ref'; import {InjectionToken} from './injection_token'; -import {ClassProvider, ExistingProvider, FactoryProvider, Provider, TypeProvider, ValueProvider} from './interface/provider'; +import {ClassProvider, ExistingProvider, FactoryProvider, Provider, TypeProvider, ValueProvider} from './interface'; import {Inject, Optional, Self, SkipSelf} from './metadata'; import {invalidProviderError, mixingMultiProvidersWithRegularProvidersError, noAnnotationError} from './reflective_errors'; import {ReflectiveKey} from './reflective_key'; diff --git a/packages/core/src/di/scope.ts b/packages/core/src/di/scope.ts index 240ee2af0b..6c9c13bc6a 100644 --- a/packages/core/src/di/scope.ts +++ b/packages/core/src/di/scope.ts @@ -6,7 +6,6 @@ * found in the LICENSE file at https://angular.io/license */ -import {Type} from '../interface/type'; import {InjectionToken} from './injection_token'; diff --git a/packages/core/src/di/util.ts b/packages/core/src/di/util.ts index de0294beb7..40f7c9e1ac 100644 --- a/packages/core/src/di/util.ts +++ b/packages/core/src/di/util.ts @@ -11,7 +11,7 @@ import {ReflectionCapabilities} from '../reflection/reflection_capabilities'; import {getClosureSafeProperty} from '../util/property'; import {inject, injectArgs} from './injector_compatibility'; -import {ClassSansProvider, ConstructorSansProvider, ExistingSansProvider, FactorySansProvider, StaticClassSansProvider, ValueProvider, ValueSansProvider} from './interface/provider'; +import {ClassSansProvider, ConstructorSansProvider, ExistingSansProvider, FactorySansProvider, StaticClassSansProvider, ValueProvider, ValueSansProvider} from './interface'; const USE_VALUE = getClosureSafeProperty({provide: String, useValue: getClosureSafeProperty}); diff --git a/packages/core/src/render/api.ts b/packages/core/src/render/api.ts index 7737518bc3..7f2290b84d 100644 --- a/packages/core/src/render/api.ts +++ b/packages/core/src/render/api.ts @@ -13,6 +13,7 @@ import {injectRenderer2 as render3InjectRenderer2} from '../render3/view_engine_ import {noop} from '../util/noop'; + /** * @deprecated Use `RendererType2` (and `Renderer2`) instead. * @publicApi diff --git a/packages/core/src/render3/di.ts b/packages/core/src/render3/di.ts index 9d210fd34b..6164fd06a5 100644 --- a/packages/core/src/render3/di.ts +++ b/packages/core/src/render3/di.ts @@ -6,13 +6,13 @@ * found in the LICENSE file at https://angular.io/license */ -import {InjectionToken} from '../di/injection_token'; +import {InjectFlags, InjectionToken} from '../di'; import {Injector} from '../di/injector'; -import {InjectFlags, injectRootLimpMode, setInjectImplementation} from '../di/injector_compatibility'; +import {injectRootLimpMode, setInjectImplementation} from '../di/injector_compatibility'; import {getInjectableDef, getInjectorDef} from '../di/interface/defs'; import {Type} from '../interface/type'; - import {assertDefined, assertEqual} from '../util/assert'; + import {getComponentDef, getDirectiveDef, getPipeDef} from './definition'; import {NG_ELEMENT_ID} from './fields'; import {DirectiveDef} from './interfaces/definition'; @@ -286,6 +286,10 @@ export function injectAttributeImpl(tNode: TNode, attrNameToInject: string): str * Look for the injector providing the token by walking up the node injector tree and then * the module injector tree. * + * This function patches `token` with `__NG_ELEMENT_ID__` which contains the id for the bloom + * filter. Negative values are reserved for special objects. + * - `-1` is reserved for injecting `Injector` (implemented by `NodeInjector`) + * * @param tNode The Node where the search for the injector should start * @param lView The `LView` that contains the `tNode` * @param token The token to look for @@ -316,6 +320,10 @@ export function getOrCreateInjectable( setTNodeAndViewData(savePreviousOrParentTNode, saveLView); } } else if (typeof bloomHash == 'number') { + if (bloomHash === -1) { + // `-1` is a special value used to identify `Injector` types. + return new NodeInjector(tNode, lView) as any; + } // If the token has a bloom hash, then it is a token which could be in NodeInjector. // A reference to the previous injector TView that was found while climbing the element @@ -531,6 +539,7 @@ export function getNodeInjectable( * * @param token the injection token * @returns the matching bit to check in the bloom filter or `null` if the token is not known. + * When the returned value is negative then it represents special values such as `Injector`. */ export function bloomHashBitOrFactory(token: Type| InjectionToken| string): number| Function|undefined { @@ -539,7 +548,8 @@ export function bloomHashBitOrFactory(token: Type| InjectionToken| str return token.charCodeAt(0) || 0; } const tokenId: number|undefined = (token as any)[NG_ELEMENT_ID]; - return typeof tokenId === 'number' ? tokenId & BLOOM_MASK : tokenId; + // Negative token IDs are used for special objects such as `Injector` + return (typeof tokenId === 'number' && tokenId > 0) ? tokenId & BLOOM_MASK : tokenId; } export function bloomHasToken( @@ -575,11 +585,6 @@ function shouldSearchParent(flags: InjectFlags, isFirstHostTNode: boolean): bool return !(flags & InjectFlags.Self) && !(flags & InjectFlags.Host && isFirstHostTNode); } -export function injectInjector() { - const tNode = getPreviousOrParentTNode() as TElementNode | TContainerNode | TElementContainerNode; - return new NodeInjector(tNode, getLView()); -} - export class NodeInjector implements Injector { constructor( private _tNode: TElementNode|TContainerNode|TElementContainerNode|null, diff --git a/packages/core/src/render3/fields.ts b/packages/core/src/render3/fields.ts index 711166a3dc..26b29af9da 100644 --- a/packages/core/src/render3/fields.ts +++ b/packages/core/src/render3/fields.ts @@ -19,4 +19,5 @@ export const NG_BASE_DEF = getClosureSafeProperty({ngBaseDef: getClosureSafeProp * the key and the directive's unique ID as the value. This allows us to map directives to their * bloom filter bit for DI. */ +// TODO(misko): This is wrong. The NG_ELEMENT_ID should never be minified. export const NG_ELEMENT_ID = getClosureSafeProperty({__NG_ELEMENT_ID__: getClosureSafeProperty}); diff --git a/packages/core/src/render3/instructions.ts b/packages/core/src/render3/instructions.ts index 688f5c92d1..ee54f486d1 100644 --- a/packages/core/src/render3/instructions.ts +++ b/packages/core/src/render3/instructions.ts @@ -6,10 +6,8 @@ * found in the LICENSE file at https://angular.io/license */ +import {InjectFlags, InjectionToken, Injector} from '../di'; import {resolveForwardRef} from '../di/forward_ref'; -import {InjectionToken} from '../di/injection_token'; -import {Injector} from '../di/injector'; -import {InjectFlags} from '../di/injector_compatibility'; import {Type} from '../interface/type'; import {QueryList} from '../linker'; import {Sanitizer} from '../sanitization/security'; diff --git a/packages/core/src/render3/interfaces/injector.ts b/packages/core/src/render3/interfaces/injector.ts index dc1f660cb2..3fb9533d72 100644 --- a/packages/core/src/render3/interfaces/injector.ts +++ b/packages/core/src/render3/interfaces/injector.ts @@ -7,8 +7,9 @@ */ import {InjectionToken} from '../../di/injection_token'; -import {InjectFlags} from '../../di/injector_compatibility'; +import {InjectFlags} from '../../di/interface'; import {Type} from '../../interface/type'; + import {TElementNode} from './node'; import {LView, TData} from './view'; diff --git a/packages/core/src/render3/ng_module_ref.ts b/packages/core/src/render3/ng_module_ref.ts index d4944bb232..4607cf78e3 100644 --- a/packages/core/src/render3/ng_module_ref.ts +++ b/packages/core/src/render3/ng_module_ref.ts @@ -7,8 +7,7 @@ */ import {INJECTOR, Injector} from '../di/injector'; -import {InjectFlags} from '../di/injector_compatibility'; -import {StaticProvider} from '../di/interface/provider'; +import {InjectFlags, StaticProvider} from '../di/interface'; import {createInjector} from '../di/r3_injector'; import {Type} from '../interface/type'; import {ComponentFactoryResolver as viewEngine_ComponentFactoryResolver} from '../linker/component_factory_resolver'; diff --git a/packages/core/src/view/refs.ts b/packages/core/src/view/refs.ts index 4dcc5e2f78..6c4b2e0b90 100644 --- a/packages/core/src/view/refs.ts +++ b/packages/core/src/view/refs.ts @@ -9,7 +9,7 @@ import {ApplicationRef} from '../application_ref'; import {ChangeDetectorRef} from '../change_detection/change_detection'; import {Injector} from '../di/injector'; -import {InjectFlags} from '../di/injector_compatibility'; +import {InjectFlags} from '../di/interface'; import {Type} from '../interface/type'; import {ComponentFactory, ComponentRef} from '../linker/component_factory'; import {ComponentFactoryBoundToModule, ComponentFactoryResolver} from '../linker/component_factory_resolver'; diff --git a/packages/core/test/bundling/injection/bundle.golden_symbols.json b/packages/core/test/bundling/injection/bundle.golden_symbols.json index f15c3c359d..8f438c3f98 100644 --- a/packages/core/test/bundling/injection/bundle.golden_symbols.json +++ b/packages/core/test/bundling/injection/bundle.golden_symbols.json @@ -6,7 +6,7 @@ "name": "CIRCULAR$1" }, { - "name": "EMPTY_ARRAY$1" + "name": "EMPTY_ARRAY$2" }, { "name": "EmptyErrorImpl" @@ -33,7 +33,7 @@ "name": "NOT_YET" }, { - "name": "NULL_INJECTOR$2" + "name": "NULL_INJECTOR$1" }, { "name": "NullInjector" @@ -63,7 +63,7 @@ "name": "THROW_IF_NOT_FOUND" }, { - "name": "USE_VALUE" + "name": "USE_VALUE$2" }, { "name": "UnsubscriptionErrorImpl" diff --git a/packages/core/test/render3/render_util.ts b/packages/core/test/render3/render_util.ts index 51d64e2906..439c10185b 100644 --- a/packages/core/test/render3/render_util.ts +++ b/packages/core/test/render3/render_util.ts @@ -16,7 +16,7 @@ import {getLView} from '@angular/core/src/render3/state'; import {stringifyElement} from '@angular/platform-browser/testing/src/browser_util'; import {SWITCH_CHANGE_DETECTOR_REF_FACTORY__POST_R3__ as R3_CHANGE_DETECTOR_REF_FACTORY} from '../../src/change_detection/change_detector_ref'; -import {Injector, SWITCH_INJECTOR_FACTORY__POST_R3__ as R3_INJECTOR_FACTORY} from '../../src/di/injector'; +import {Injector} from '../../src/di/injector'; import {Type} from '../../src/interface/type'; import {SWITCH_ELEMENT_REF_FACTORY__POST_R3__ as R3_ELEMENT_REF_FACTORY} from '../../src/linker/element_ref'; import {SWITCH_TEMPLATE_REF_FACTORY__POST_R3__ as R3_TEMPLATE_REF_FACTORY} from '../../src/linker/template_ref'; @@ -368,7 +368,6 @@ export function enableIvyInjectableFactories() { R3_VIEW_CONTAINER_REF_FACTORY(ViewContainerRef, ElementRef); (ChangeDetectorRef as any)[NG_ELEMENT_ID] = () => R3_CHANGE_DETECTOR_REF_FACTORY(); (Renderer2 as any)[NG_ELEMENT_ID] = () => R3_RENDERER2_FACTORY(); - (Injector as any)[NG_ELEMENT_ID] = () => R3_INJECTOR_FACTORY(); } export class MockRendererFactory implements RendererFactory3 { diff --git a/packages/core/test/view/ng_module_spec.ts b/packages/core/test/view/ng_module_spec.ts index 6b3cbc7687..67bb917b0c 100644 --- a/packages/core/test/view/ng_module_spec.ts +++ b/packages/core/test/view/ng_module_spec.ts @@ -7,8 +7,8 @@ */ import {NgModuleRef} from '@angular/core'; +import {InjectFlags, inject} from '@angular/core/src/di'; import {INJECTOR, Injector} from '@angular/core/src/di/injector'; -import {InjectFlags, inject} from '@angular/core/src/di/injector_compatibility'; import {InjectableDef, defineInjectable} from '@angular/core/src/di/interface/defs'; import {NgModuleDefinition, NgModuleProviderDef, NodeFlags} from '@angular/core/src/view'; import {moduleDef} from '@angular/core/src/view/ng_module';