From 837889f0a47521d3de5c445ac3ffeedfe47fc109 Mon Sep 17 00:00:00 2001 From: Dirk Luijk Date: Wed, 22 Aug 2018 14:41:26 +0200 Subject: [PATCH] fix(router): make relativeLinkResolution corrected by default (#25609) We are changing the default value from 'legacy' to 'corrected' so that new applications are automatically opted-in to the corrected behavior from #22394. BREAKING CHANGE: This commit changes the default value of `relativeLinkResolution` from `'legacy'` to `'default'`. If your application previously used the default by not specifying a value in the `ExtraOptions` and uses relative links when navigating from children of empty path routes, you will need to update your `RouterModule` to specifically specify `'legacy'` for `relativeLinkResolution`. See https://angular.io/api/router/ExtraOptions#relativeLinkResolution for more details. PR Close #25609 --- packages/router/src/router.ts | 2 +- packages/router/src/router_module.ts | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/packages/router/src/router.ts b/packages/router/src/router.ts index b1f1f744cb..334751907b 100644 --- a/packages/router/src/router.ts +++ b/packages/router/src/router.ts @@ -443,7 +443,7 @@ export class Router { * Enables a bug fix that corrects relative link resolution in components with empty paths. * @see `RouterModule` */ - relativeLinkResolution: 'legacy'|'corrected' = 'legacy'; + relativeLinkResolution: 'legacy'|'corrected' = 'corrected'; /** * Creates the router service. diff --git a/packages/router/src/router_module.ts b/packages/router/src/router_module.ts index a9eda6529f..974839fa36 100644 --- a/packages/router/src/router_module.ts +++ b/packages/router/src/router_module.ts @@ -425,8 +425,9 @@ export interface ExtraOptions { * * `Link to A` * - * In other words, you're required to use `../` rather than `./`. This is currently the default - * behavior. Setting this option to `corrected` enables the fix. + * In other words, you're required to use `../` rather than `./`. + * + * The default in v11 is `corrected`. */ relativeLinkResolution?: 'legacy'|'corrected'; }