The current version of an app we have running uses useHash: true
in its app-routing.module.ts
. In a new version I am developing I am not doing so (mostly because I wasn't even aware of it).
Since the general routes to use the app have changed, I'd like to show some kind of information message and then forward the user to the "new and correct" route to use when the user accesses a URL of the previous version.
The app is often accessed using browser book marks and in there are IDs and other parameters that are used in the application. My plan was to show this (lets call it migration-information
component) under all URLs in the format of the old app, retrieve the parameters and forward the user to the new URL(s).
However I noticed that when using useHash: false
(the default) I can't capture routes that start with #
at all, but rather the wildcard route (**
) gets triggered.
Is there any way I could capture the hash routes even when not using them in other places of the app? I tried to explicitly set a #
in front of the legacy routes but that didn't lead to anything.
Is using useHash: true
the only way to deal with this problem?