my question in a nutshell:
Why does angular router in hash mode change the base of the url path to what I have set for my base href? And how do I prevent this behavior?
for more detail on my use case ...
I'm using hash routing in an Angular 8 application.
In my index.html page (which is an MVC page generated on the server) I have to specify a base href so that my html page knows where to load all of the js and css files generated by the angular-cli build. After the angular app loads, the base path in url in the address bar is changed to the base href I specified in my index.html. This causes problems when I try to reload the page, because the url is no longer pointing to the original url that I requested when I first loaded the app.
My questions is: how do I turn off this behavior or prevent angular from changing the url like this? I feel like angular shouldn't care about anything in the url before the hash if I'm using hash routing. I searched the Angular code base and couldn't find the cause.
(this is not default browser behavior that I'm seeing. On its own, when you load a simple html file that has a base href specified, the browser doesn't change the url from the one you originally requested. I tested this just to make sure I'm not crazy).
I could implement a workaround by providing my own LocationStrategy. I don't have any problem doing this, but I feel like I shouldn't have to take an extra step just to maintain default browser behavior when angular shouldn't care anyways. As a work around, I can also remove the base href and provide a --deploy-url when building the app, but this is again an extra step, when the browser could handle loading the files properly on its own and not messing with the url.
I created this repo with a basic example that reproduces the problem and provides a little more detail. I KNOW the express server is probably not configured "correctly". It's only set up to illustrate how I'm having to deal with files in my use case. Please focus on the angular question stated at the beginning of the post and not ancillary details.
Update
I opened an issue with angular as this seems to be a defect somewhere in the angular code base. https://github.com/angular/angular/issues/33000.