angular-docs-cn/packages/core/schematics/migrations/relative-link-resolution
Andrew Scott 15ea811f05 feat(router): Add `relativeLinkResolution` migration to update default value (#38698)
The default value for `relativeLinkResolution` is changing from 'legacy' to 'corrected'.
This migration updates `RouterModule` configurations that use the default value to
now specifically use 'legacy' to prevent breakages when updating.

PR Close #38698
2020-09-23 15:45:37 -04:00
..
google3 feat(router): Add `relativeLinkResolution` migration to update default value (#38698) 2020-09-23 15:45:37 -04:00
BUILD.bazel feat(router): Add `relativeLinkResolution` migration to update default value (#38698) 2020-09-23 15:45:37 -04:00
README.md feat(router): Add `relativeLinkResolution` migration to update default value (#38698) 2020-09-23 15:45:37 -04:00
collector.ts feat(router): Add `relativeLinkResolution` migration to update default value (#38698) 2020-09-23 15:45:37 -04:00
index.ts feat(router): Add `relativeLinkResolution` migration to update default value (#38698) 2020-09-23 15:45:37 -04:00
transform.ts feat(router): Add `relativeLinkResolution` migration to update default value (#38698) 2020-09-23 15:45:37 -04:00
update_recorder.ts feat(router): Add `relativeLinkResolution` migration to update default value (#38698) 2020-09-23 15:45:37 -04:00
util.ts feat(router): Add `relativeLinkResolution` migration to update default value (#38698) 2020-09-23 15:45:37 -04:00

README.md

relativeLinkResolution migration

The default value for relativeLinkResolution is changing from 'legacy' to 'corrected'. This migration updates RouterModule configurations that use the default value to now specifically use 'legacy' to prevent breakages when updating.

Before

import { NgModule } from '@angular/core';
import { RouterModule } from '@angular/router';

@NgModule({
  imports: [
    RouterModule.forRoot(ROUTES),
  ]
})
export class AppModule {
}

After

import { NgModule } from '@angular/core';
import { RouterModule } from '@angular/router';

@NgModule({
  imports: [
    RouterModule.forRoot(ROUTES, {relativeLinkResolution: 'legacy'}),
  ]
})
export class AppModule {
}