Hi, we are having an issue with this library on the project I'm working on, and both seem to be connected to redirectTo. We use it along with localizeRedirectTo to redirect the user from, say, /login to /{lang}/login. However, in these scenarios, the query parameters and fragments are removed. According to https://github.com/angular/angular/issues/13315#issuecomment-427254639, the way to fix this is by removing the beginning slash from the redirectTo value. In this library, that would mean modifying localize-router.parser.ts in the following way:
addPrefixToUrl(url: string): string {
const plitedUrl = url.split('?');
plitedUrl[0] = plitedUrl[0].replace(/\/$/, '');
return `${this.urlPrefix}${plitedUrl.join('?')}`; // <- removed the slash in the beginning of this string
}
Upon testing this locally by modifying the .mjs files, this seems to fix this specific issue, however I'm not 100% sure that it won't affect anything else.
Alternatively, a solution that would surely fix this without affecting else, but at the cost of essentially being a workaround, would be to remove the slash only when translating redirectTo in _translateRouteTree:
Hi, we are having an issue with this library on the project I'm working on, and both seem to be connected to
redirectTo
. We use it along withlocalizeRedirectTo
to redirect the user from, say,/login
to/{lang}/login
. However, in these scenarios, the query parameters and fragments are removed. According to https://github.com/angular/angular/issues/13315#issuecomment-427254639, the way to fix this is by removing the beginning slash from theredirectTo
value. In this library, that would mean modifyinglocalize-router.parser.ts
in the following way:Upon testing this locally by modifying the
.mjs
files, this seems to fix this specific issue, however I'm not 100% sure that it won't affect anything else.Alternatively, a solution that would surely fix this without affecting else, but at the cost of essentially being a workaround, would be to remove the slash only when translating
redirectTo
in_translateRouteTree
:Would it be possible to look into this?