diff --git a/aio/content/examples/ngmodules/src/app/greeting/greeting.module.ts b/aio/content/examples/ngmodules/src/app/greeting/greeting.module.ts index 952c5efcb1..92f39bfb60 100644 --- a/aio/content/examples/ngmodules/src/app/greeting/greeting.module.ts +++ b/aio/content/examples/ngmodules/src/app/greeting/greeting.module.ts @@ -23,7 +23,7 @@ export class GreetingModule { // #enddocregion ctor // #docregion for-root - static forRoot(config: UserServiceConfig): ModuleWithProviders { + static forRoot(config: UserServiceConfig): ModuleWithProviders { return { ngModule: GreetingModule, providers: [ diff --git a/aio/tools/examples/shared/boilerplate/testing/tsconfig.app.json b/aio/tools/examples/shared/boilerplate/testing/tsconfig.app.json index fdc41f9303..9ffed7628a 100644 --- a/aio/tools/examples/shared/boilerplate/testing/tsconfig.app.json +++ b/aio/tools/examples/shared/boilerplate/testing/tsconfig.app.json @@ -2,7 +2,9 @@ "extends": "./tsconfig.json", "compilerOptions": { "outDir": "../out-tsc/app", - "types": [] + "types": [], + // TODO(FW-2145): turn lib checks back on after fixing in-memory-api and investigating impact of ModuleWithProviders + "skipLibCheck": true }, "files": [ "src/main.ts", diff --git a/aio/tools/examples/shared/boilerplate/viewengine/cli/tsconfig.json b/aio/tools/examples/shared/boilerplate/viewengine/cli/tsconfig.json index e4816a58e7..8fe166d73a 100644 --- a/aio/tools/examples/shared/boilerplate/viewengine/cli/tsconfig.json +++ b/aio/tools/examples/shared/boilerplate/viewengine/cli/tsconfig.json @@ -17,7 +17,9 @@ "lib": [ "es2018", "dom" - ] + ], + // TODO(FW-2145): turn lib checks back on after fixing in-memory-api and investigating impact of ModuleWithProviders + "skipLibCheck": true }, "angularCompilerOptions": { "enableIvy": false, diff --git a/aio/tools/examples/shared/tsconfig.json b/aio/tools/examples/shared/tsconfig.json index b564f9cb9f..d6df8f5d46 100644 --- a/aio/tools/examples/shared/tsconfig.json +++ b/aio/tools/examples/shared/tsconfig.json @@ -13,7 +13,9 @@ "suppressImplicitAnyIndexErrors": true, "typeRoots": [ "node_modules/@types" - ] + ], + // TODO(FW-2145): turn lib checks back on after fixing in-memory-api and investigating impact of ModuleWithProviders + "skipLibCheck": true }, "include": [ "../../../content/examples/*/e2e-spec.ts" diff --git a/goldens/public-api/core/core.d.ts b/goldens/public-api/core/core.d.ts index 1ef0aa6585..915a1f657e 100644 --- a/goldens/public-api/core/core.d.ts +++ b/goldens/public-api/core/core.d.ts @@ -559,7 +559,7 @@ export declare class ModuleWithComponentFactories { constructor(ngModuleFactory: NgModuleFactory, componentFactories: ComponentFactory[]); } -export declare interface ModuleWithProviders { +export declare interface ModuleWithProviders { ngModule: Type; providers?: Provider[]; } diff --git a/packages/core/src/metadata/ng_module.ts b/packages/core/src/metadata/ng_module.ts index 2d947c53fc..be7ade3767 100644 --- a/packages/core/src/metadata/ng_module.ts +++ b/packages/core/src/metadata/ng_module.ts @@ -82,16 +82,14 @@ export interface NgModuleDef { /** * A wrapper around an NgModule that associates it with the providers. * - * @param T the module type. In Ivy applications, this must be explicitly - * provided. + * @param T the module type. * * Note that using ModuleWithProviders without a generic type is deprecated. * The generic will become required in a future version of Angular. * * @publicApi */ -export interface ModuleWithProviders< - T = any /** TODO(alxhub): remove default when callers pass explicit type param */> { +export interface ModuleWithProviders { ngModule: Type; providers?: Provider[]; }