Guys this is driving me crazy, been fighting for hours on this, and couldn\'t find a solution!
I know that in order to clean the hashtag from the URL path, i need to use
When you hit F5, you're not using an angular directive or anything angular-related. You simply tell the browser to send a new request to the URL that is currently in the address bar, and to refresh the page with what comes back from the server. So if the current location is http://localhost:8080/mywork
, a request will be sent to http://localhost:8080/mywork
, and if the server doesn't have anything configured to handle this URL, you'll get a 404.
Now, if you configure the server to return the main angular HTML page when the URL /mywork
is hit, then the browser will display this HTML page and execute the JavaScript it contains. The angular router will detect that the location is /mywork, and it will thus load the partial and the controller associated with this location, and display the appropriate template.
The old, hashbang-based routing doesn't need any configuration of the backend because the URL is always the same. Only the part after the hashbang (unknown by the server), changes.