8000 feat(core): add ModuleWithProviders generic type migration by CaerusKaru · Pull Request #33217 · angular/angular · GitHub
[go: up one dir, main page]

Skip to content

feat(core): add ModuleWithProviders generic type migration #33217

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fixup! feat(core): add ModuleWithProviders generic type migration
  • Loading branch information
CaerusKaru committed Oct 18, 2019
commit eb94839ba57778fbfb97da1b7e7022d4a608013f
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
## ModuleWithProviders migration

Automatically migrates `ModuleWithProviders` to include explicit generic typing. The
`ModuleWithProviders` type will not default to the `any` type for its generic as of v9.
ModuleWithProviders` type will not default to the `any` type for its generic in a future version of Angular.

#### Before
```ts
Expand Down
6 changes: 4 additions & 2 deletions packages/core/src/metadata/ng_module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,13 @@ export interface NgModuleDef<T> {
/**
* A wrapper around an NgModule that associates it with the providers.
*
* @param T the module type.
* @param T the module type. In Ivy applications, this must be explicitly
* provided.
*
* @publicApi
*/
export interface ModuleWithProviders<T> {
export interface ModuleWithProviders<
T = any /** TODO(alxhub): remove default when callers pass explicit type param */> {
ngModule: Type<T>;
providers?: Provider[];
}
Expand Down
0