From d4f44bde5010d9631e0b079af7a96020f758ddfd Mon Sep 17 00:00:00 2001 From: Andrew Scott Date: Thu, 11 Aug 2022 18:55:07 -0700 Subject: [PATCH] refactor(router): Provide easily patchable file for assigning relativeLinkResolution (#47136) For context on the migration plan, see b/241955063 PR Close #47136 --- .../src/patchable_relative_link_resolution.ts | 13 +++++++++++++ packages/router/src/router.ts | 3 +++ 2 files changed, 16 insertions(+) create mode 100644 packages/router/src/patchable_relative_link_resolution.ts diff --git a/packages/router/src/patchable_relative_link_resolution.ts b/packages/router/src/patchable_relative_link_resolution.ts new file mode 100644 index 00000000000..e62a8b4cffb --- /dev/null +++ b/packages/router/src/patchable_relative_link_resolution.ts @@ -0,0 +1,13 @@ +/** + * @license + * Copyright Google LLC All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.io/license + */ + +/** + * Exists to aid internal migration off of the deprecated relativeLinkResolution option. + */ +export function assignRelativeLinkResolution( + router: {relativeLinkResolution: 'legacy'|'corrected'}): void {} diff --git a/packages/router/src/router.ts b/packages/router/src/router.ts index 9d3ea35f604..9bb35101f50 100644 --- a/packages/router/src/router.ts +++ b/packages/router/src/router.ts @@ -24,6 +24,7 @@ import {recognize} from './operators/recognize'; import {resolveData} from './operators/resolve_data'; import {switchTap} from './operators/switch_tap'; import {DefaultTitleStrategy, TitleStrategy} from './page_title_strategy'; +import {assignRelativeLinkResolution} from './patchable_relative_link_resolution'; import {DefaultRouteReuseStrategy, RouteReuseStrategy} from './route_reuse_strategy'; import {ErrorHandler, ExtraOptions, ROUTER_CONFIGURATION} from './router_config'; import {RouterConfigLoader, ROUTES} from './router_config_loader'; @@ -349,6 +350,8 @@ export function setupRouter() { assignExtraOptionsToRouter(opts, router); + assignRelativeLinkResolution(router); + return router; }