refactor(core): make generic mandatory for ModuleWithProviders (#36892)

In v9, we deprecated the use of ModuleWithProviders
without a generic. In v10, we will be requiring the
generic when using ModuleWithProviders. You can read
more about the reasoning behind this change in the
migration guide:
http://v9.angular.io/guide/migration-module-with-providers

PR Close #36892
This commit is contained in:
Kara Erickson
2020-05-01 16:39:22 -07:00
committed by Alex Rickabaugh
parent 420b9be1c1
commit 20cc3ab37e
6 changed files with 13 additions and 9 deletions

View File

@ -82,16 +82,14 @@ export interface NgModuleDef<T> {
/**
* 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<T> {
ngModule: Type<T>;
providers?: Provider[];
}