Router Service need a way to construct and recognize absolute URL
- Dominant language
- TypeScript
- Stars
- 22.6k
- Forks
- 4.2k
- Avg merge
- 3d 12h
- Merged PRs (30d)
- 15
Description
Currently, there isn't a way to construct or recognize an "absolute" URL, i.e. `window.location.origin ( + routerService.rootURL ) + routerService.currentURL`.
This will become important when we want to intercept all link clicks on the page and have to decide whether to do a transition or a full navigation.
Things to consider: do we need to "virtualize" the "origin" too, or is it fine to always use `window.location.origin`? Probably need to virtualize it somewhat, because FastBoot and tests, but then we will probably need a way to set a fallback when we cannot infer it from the page, not too dissimilar with the same problem in Rails, where most of the time you can infer it from the protocol/host/port incoming HTTP request, but sometimes you cannot (in a non-http context, such as background jobs/workers, sending emails, etc).
This is only slightly related to #18422, in that if we are going to find a new name or change the API, maybe we can also take this into the account, either by making sure the names are consistent or maybe have a method that takes an option.
Contributor guide
Assessment
This issue has not been assessed yet.