angular-cn/packages/core/schematics/migrations/module-with-providers
Joey Perrott 698b0288be build: reformat repo to new clang@1.4.0 (#36613)
PR Close #36613
2020-04-14 12:08:36 -07:00
..
BUILD.bazel feat(core): add ModuleWithProviders generic type migration (#33217) 2019-10-21 15:53:28 -04:00
README.md feat(core): add ModuleWithProviders generic type migration (#33217) 2019-10-21 15:53:28 -04:00
collector.ts build: reformat repo to new clang@1.4.0 (#36613) 2020-04-14 12:08:36 -07:00
index.ts fix(core): avoid migration error when non-existent symbol is imported (#36367) 2020-04-06 13:21:54 -07:00
transform.ts build: reformat repo to new clang@1.4.0 (#36613) 2020-04-14 12:08:36 -07:00
util.ts feat(core): add ModuleWithProviders generic type migration (#33217) 2019-10-21 15:53:28 -04:00

README.md

ModuleWithProviders migration

ModuleWithProviders type will not default to the any type for its generic in a future version of Angular. This migration adds a generic to any ModuleWithProvider types found.

Before

import { NgModule, ModuleWithProviders } from '@angular/core';

@NgModule({})
export class MyModule {
  static forRoot(): ModuleWithProviders {
    ngModule: MyModule
  }
}

After

import { NgModule, ModuleWithProviders } from '@angular/core';

@NgModule({})
export class MyModule {
  static forRoot(): ModuleWithProviders<MyModule> {
    ngModule: MyModule
  }
}