Angular1 location html5mode equivalent in angular2
I am trying to find where I can enable html5mode in angular2. Unfortunately couldnt find it out from the documentation or anywhere. I am using gulp and browser-sync to load my files.
I have seen that many says to use connect-modrewrite something like
When using this you will need to set your server to redirect ALL requests to the root URL. For example if your user requests myApp.com/someRoute then assets will be resolved from that url which is incorrect. Instead you want the server to serve the index.html page regardless of the route specified, but still keep the route intact so that it can be used by the client-side application.
Also be sure to set your <base path="/" /> tag in the head of your HTML.
Asked in February 2016Viewed 2,111 timesVoted 12Answered 1 times