angular-docs-cn/packages/core/schematics/migrations/module-with-providers
Adam Plumer 0ec7043490 feat(core): add initialNavigation schematic (#36926)
Add a schematic to update users to the new v11 `initialNavigation`
options for `RouterModule`. This replaces the deprecated/removed
`true`, `false`, `legacy_disabled`, and `legacy_enabled` options
with the newer `enabledBlocking` and `enabledNonBlocking` options.

PR Close #36926
2020-10-14 12:01:07 -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: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
index.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
transform.ts feat(core): add initialNavigation schematic (#36926) 2020-10-14 12:01:07 -07:00
util.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -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
  }
}