Skip to content

feat(mf-tools): enhance connectRouter to support baseHref for URL navigation#935

Merged
Aukevanoost merged 1 commit intoangular-architects:mainfrom
IosebKoplatadze:main
Mar 4, 2026
Merged

feat(mf-tools): enhance connectRouter to support baseHref for URL navigation#935
Aukevanoost merged 1 commit intoangular-architects:mainfrom
IosebKoplatadze:main

Conversation

@IosebKoplatadze
Copy link
Contributor

This pull request updates module federation tools, the micro frontend router integration to improve support for custom base hrefs in Angular applications. The main changes ensure that the router correctly handles navigation when a base href is set, which is important for apps deployed under sub-paths.

Routing improvements:

  • Added retrieval of APP_BASE_HREF from the Angular injector and passed it to the router connection logic in bootstrap-utils.ts, enabling dynamic base href support. [1] [2]
  • Updated the connectRouter function in router-utils.ts to accept a baseHref parameter and remove the base href from the beginning of navigation URL if present, ensuring correct routing behavior for apps with a non-root base path.

@IosebKoplatadze
Copy link
Contributor Author

@Aukevanoost can i get review please?

@Aukevanoost Aukevanoost merged commit bc286f6 into angular-architects:main Mar 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants