diff --git a/packages/compiler/src/render3/r3_module_compiler.ts b/packages/compiler/src/render3/r3_module_compiler.ts index 8b83f25931..921bae7ecf 100644 --- a/packages/compiler/src/render3/r3_module_compiler.ts +++ b/packages/compiler/src/render3/r3_module_compiler.ts @@ -107,7 +107,8 @@ export function compileInjector(meta: R3InjectorMetadata): R3InjectorDef { providers: meta.providers, imports: meta.imports, })]); - const type = new o.ExpressionType(o.importExpr(R3.InjectorDef)); + const type = + new o.ExpressionType(o.importExpr(R3.InjectorDef, [new o.ExpressionType(meta.type)])); return {expression, type}; } diff --git a/tools/public_api_guard/core/core.d.ts b/tools/public_api_guard/core/core.d.ts index 04893d869f..09052c005c 100644 --- a/tools/public_api_guard/core/core.d.ts +++ b/tools/public_api_guard/core/core.d.ts @@ -408,6 +408,12 @@ export declare abstract class Injector { /** @experimental */ export declare const INJECTOR: InjectionToken; +export interface InjectorDef { + factory: () => T; + imports: (InjectorType | InjectorTypeWithProviders)[]; + providers: (Type | ValueProvider | ExistingProvider | FactoryProvider | ConstructorProvider | StaticClassProvider | ClassProvider | any[])[]; +} + /** @experimental */ export interface InjectorType extends Type { ngInjectorDef: never;