diff --git a/libs/angular-webcomponents/src/lib/utils/webcomponent-bootstrap.utils.ts b/libs/angular-webcomponents/src/lib/utils/webcomponent-bootstrap.utils.ts index 45622390..7e84bb30 100644 --- a/libs/angular-webcomponents/src/lib/utils/webcomponent-bootstrap.utils.ts +++ b/libs/angular-webcomponents/src/lib/utils/webcomponent-bootstrap.utils.ts @@ -165,14 +165,16 @@ function connectMicroFrontendRouter(injector: Injector, warn = true): Subscripti function connectRouter(router: Router): Subscription { const initialUrl = `${location.pathname.substring(getLocation().deploymentPath.length)}${location.search}` - router.navigateByUrl(initialUrl) + router.navigate([initialUrl], { fragment: location.hash.substring(1) }) let lastUrl = initialUrl + let lastHash = location.hash const observer = new EventsTopic() return observer.pipe(filter((e) => e.type === 'navigated')).subscribe(() => { const routerUrl = `${location.pathname.substring(getLocation().deploymentPath.length)}${location.search}` - if (routerUrl !== lastUrl) { + if (routerUrl !== lastUrl || location.hash !== lastHash) { lastUrl = routerUrl - router.navigateByUrl(routerUrl) + lastHash = location.hash + router.navigate([routerUrl], { fragment: location.hash.substring(1) }) } }) } diff --git a/package-lock.json b/package-lock.json index 95b8df03..c52f7cec 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@onecx/onecx-portal-ui-libs", - "version": "5.7.0", + "version": "5.9.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@onecx/onecx-portal-ui-libs", - "version": "5.7.0", + "version": "5.9.1", "hasInstallScript": true, "license": "Apache-2.0", "dependencies": { @@ -117,7 +117,7 @@ }, "libs/portal-layout-styles": { "name": "@onecx/portal-layout-styles", - "version": "5.7.0", + "version": "5.9.1", "license": "Apache-2.0", "peerDependencies": { "tslib": "^2.6.3"