diff --git a/libs/mf-tools/src/lib/web-components/router-utils.ts b/libs/mf-tools/src/lib/web-components/router-utils.ts index 8feac8e9..feb148e6 100644 --- a/libs/mf-tools/src/lib/web-components/router-utils.ts +++ b/libs/mf-tools/src/lib/web-components/router-utils.ts @@ -20,17 +20,20 @@ export function endsWith(prefix: string): UrlMatcher { }; } -export function connectRouter(router: Router, useHash = false) { +export function connectRouter(router: Router, useHash = false): void { + let url: string; if (!useHash) { - router.navigateByUrl(location.pathname.substr(1)); + url = `${location.pathname.substr(1)}${location.search}`; + router.navigateByUrl(url); window.addEventListener('popstate', () => { - router.navigateByUrl(location.pathname.substr(1)); + router.navigateByUrl(url); }); } else { - router.navigateByUrl(location.hash.substr(1)); + url = `${location.hash.substr(1)}${location.search}`; + router.navigateByUrl(url); window.addEventListener('hashchange', () => { - router.navigateByUrl(location.hash.substr(1)); + router.navigateByUrl(url); }); } } \ No newline at end of file diff --git a/libs/mf/README.md b/libs/mf/README.md index a206189e..30bd89d9 100644 --- a/libs/mf/README.md +++ b/libs/mf/README.md @@ -271,7 +271,7 @@ shared: share({ strictVersion: true, requiredVersion: 'auto', includeSecondaries: { - skip: ['@angular/http/testing'] + skip: ['@angular/common/http/testing'] } }, [...] diff --git a/libs/mf/src/utils/share-utils.ts b/libs/mf/src/utils/share-utils.ts index 307104af..c382c018 100644 --- a/libs/mf/src/utils/share-utils.ts +++ b/libs/mf/src/utils/share-utils.ts @@ -112,7 +112,7 @@ function addSecondaries(secondaries: string[], result: Config, shareObject: Conf } } -export function shareAll(config: Config = {}, skip: string[] = [], packageJsonPath = ''): void { +export function shareAll(config: Config = {}, skip: string[] = [], packageJsonPath = ''): Config { if (!packageJsonPath) { const stack = callsite();