File tree Expand file tree Collapse file tree 1 file changed +8
-5
lines changed
libs/mf-tools/src/lib/web-components Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -20,17 +20,20 @@ export function endsWith(prefix: string): UrlMatcher {
2020 } ;
2121}
2222
23- export function connectRouter ( router : Router , useHash = false ) {
23+ export function connectRouter ( router : Router , useHash = false ) : void {
24+ let url : string ;
2425 if ( ! useHash ) {
25- router . navigateByUrl ( location . pathname . substr ( 1 ) ) ;
26+ url = `${ location . pathname . substr ( 1 ) } ${ location . search } ` ;
27+ router . navigateByUrl ( url ) ;
2628 window . addEventListener ( 'popstate' , ( ) => {
27- router . navigateByUrl ( location . pathname . substr ( 1 ) ) ;
29+ router . navigateByUrl ( url ) ;
2830 } ) ;
2931 }
3032 else {
31- router . navigateByUrl ( location . hash . substr ( 1 ) ) ;
33+ url = `${ location . hash . substr ( 1 ) } ${ location . search } ` ;
34+ router . navigateByUrl ( url ) ;
3235 window . addEventListener ( 'hashchange' , ( ) => {
33- router . navigateByUrl ( location . hash . substr ( 1 ) ) ;
36+ router . navigateByUrl ( url ) ;
3437 } ) ;
3538 }
3639}
You can’t perform that action at this time.
0 commit comments