I found that the URL addresses of many Angular single-page applications are in the following format:
http://your.domain/page/#/app/forms/validate
There is always a number in the middle of #
, which looks very unpleasant. Is there any way to change
to the following style:
http://your.domain/app/forms
Also: Can Angular's single page be replaced with pushState? Or use a plug-in called Pjax
I hope you can give me some tips, I’m a bit confused about this!
If it is angular 1.x, you can add a sentence at the end of the route
$locationProvider.html5Mode(true);
This routing scheme defaults to the hash method starting with #. If you do not consider lower version browsers, you can directly call $locationProvider.html5Mode(true) to use the H5 scheme instead of the hash scheme.
If you are interested, please read my article directly. There is an article explaining the front-end routing mechanism in detail