angular-cn/packages/core/schematics/migrations/module-with-providers
Alan Agius 8b5ca670ad refactor(core): update migrations descriptions (#33440)
With the next version of the CLI we don't need to add logging for the description of the schematic as part of the schematic itself.

This is because now, the CLI will print the description defined in the `migrations.json` file.

See: https://github.com/angular/angular-cli/pull/15951

PR Close #33440
2019-10-28 17:07:50 -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 feat(core): add ModuleWithProviders generic type migration (#33217) 2019-10-21 15:53:28 -04:00
index.ts refactor(core): update migrations descriptions (#33440) 2019-10-28 17:07:50 -07:00
transform.ts feat(core): add ModuleWithProviders generic type migration (#33217) 2019-10-21 15:53:28 -04: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
  }
}