Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
manfredsteyer committed Feb 13, 2022
2 parents 4eb53ff + 5ba3753 commit f4b5dc2
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
13 changes: 8 additions & 5 deletions libs/mf-tools/src/lib/web-components/router-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});
}
}
2 changes: 1 addition & 1 deletion libs/mf/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ shared: share({
strictVersion: true,
requiredVersion: 'auto',
includeSecondaries: {
skip: ['@angular/http/testing']
skip: ['@angular/common/http/testing']
}
},
[...]
Expand Down
2 changes: 1 addition & 1 deletion libs/mf/src/utils/share-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit f4b5dc2

Please sign in to comment.