I want to get the query and pathname in routeChangeStart
event
If I push, or Link with as
path, I can only get as
in url
parameter of routeChangeStart.
function(url: string) {}
becomes
function(as: string, {query, pathname, ...})
A clear and concise description of any alternative solutions or features you've considered.
Actually, I want route cancellation like #2476 described. I can achieve it by throwing an error here to block the destination URL and display a custom modal to prompt user. If the user choose to continue, then navigate to the destination Url.
The problem is that I can't use Router.push(url) because the url is as
url, not the exact pathname
. The only user-unfriendly workaround is to force reload by window.location.href = url
and it will be handled by the node.js express server.
P.S. I can't use confirm() to do this because we need a custom modal with 3 buttons on it.
We're not planning to increase the router size for this at this point.
I agree with this feature request. Three is 0.000000 value of providing action listeners with only one URL parameter. Do we need to implement URL parsers, get path names and so on?
This can only be used as a console logger as described at your example.
agree that at least the route information should be exposed in the router events. An URL string is too basic information to use, like for example advanced analytics, etc.
With i18n support in the routing coming soon, it will be even more important, to be able to make decisions based on the language.. would you need to regex the URL string?
Most helpful comment
I agree with this feature request. Three is 0.000000 value of providing action listeners with only one URL parameter. Do we need to implement URL parsers, get path names and so on?
This can only be used as a console logger as described at your example.