angular-cn/packages/core/schematics/migrations/module-with-providers
Kara Erickson a17cc9beee refactor(core): add links to remaining migration guides (#33385)
PR Close #33385
2019-10-24 16:21:49 -07:00
..
BUILD.bazel
README.md
collector.ts
index.ts refactor(core): add links to remaining migration guides (#33385) 2019-10-24 16:21:49 -07:00
transform.ts
util.ts

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
  }
}