From 7edca03989797f7499f3f7c031d345ccefec192b Mon Sep 17 00:00:00 2001 From: Andrew Kushnir Date: Mon, 31 Mar 2025 16:34:31 -0700 Subject: [PATCH] refactor(router): re-export the `RouterTestingModule` symbols (#60674) This commit re-exports the symbols that are exposed by the `RouterTestingModule` (which re-exports the symbols from the `RouterModule`. These re-exports are needed for the Angular compiler to overcome its limitation (on the consumer side) of not knowing where to import import symbols when relative imports are used within the package. PR Close #60674 --- packages/router/testing/src/testing.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/packages/router/testing/src/testing.ts b/packages/router/testing/src/testing.ts index 94f955aed77..83aaeac9f4a 100644 --- a/packages/router/testing/src/testing.ts +++ b/packages/router/testing/src/testing.ts @@ -13,3 +13,14 @@ */ export * from './router_testing_module'; export {RouterTestingHarness} from './router_testing_harness'; + +// Re-export the symbols that are exposed by the `RouterTestingModule` (which re-exports +// the symbols from the `RouterModule`). Re-exports are needed for the Angular compiler +// to overcome its limitation (on the consumer side) of not knowing where to import import +// symbols when relative imports are used within the package. +// Note: These exports need to be stable and shouldn't be renamed unnecessarily because +// consuming libraries might have references to them in their own partial compilation output. +export {RouterOutlet as ɵɵRouterOutlet} from '../../src/directives/router_outlet'; +export {RouterLink as ɵɵRouterLink} from '../../src/directives/router_link'; +export {RouterLinkActive as ɵɵRouterLinkActive} from '../../src/directives/router_link_active'; +export {EmptyOutletComponent as ɵɵEmptyOutletComponent} from '../../src/components/empty_outlet';