In my Angular JS website, I wish to append the text "#Page/" to the URL using Javascript. Here my problem is that the forward slash(/) is getting added when using the code Location.hash
For example, Let say the URL is https://MyWebsite.com/Products
var location = window.location;
location.hash = "#page/" + pageNumber;
window.location = location
After executing the above code, the Window.location turned out to be https://MyWebsite.com/Products/#page/1.
But what I need is the forward slash(/) should not be included between products and #page.
https://MyWebsite.com/Products#page/1.
The strange thing is that when I checked the same code with the other websites don't have Angular JS, implemented only with the Asp.net Webforms and ASP.net MVC, I got the desired result.
Does this kind of issue have something to do with the Angular JS?
I believe # is special character reserved for a page fragment reference. See https://www.ietf.org/rfc/rfc3986.txt
Can you do with without # or use the # to reference the fragment? e.g.
window.location.href += 'page/' + pageNumber + '#' + pageFragment;