angular-cn/packages/core/schematics/migrations/relative-link-resolution
Doug Parker 049b453149 fix(core): migrate relative link resolution with single quotes (#39102)
This is a roll forward of #39082, using `ts.createIdentifier(`'legacy'`)` as a cross-version compatible way of making
a single quoted string literal.

Migrated code now uses single quotes, which is in line with the default linting options, so there is no lint error after
migration.

PR Close #39102
2020-10-08 10:10:07 -07: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 fix(core): migrate relative link resolution with single quotes (#39102) 2020-10-08 10:10:07 -07: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 {
}