angular - Angular1 location html5mode equivalent in angular2 -


i trying find can enable html5mode in angular2. unfortunately couldnt find out documentation or anywhere. using gulp , browser-sync load files. have seen many says use connect-modrewrite like

browsersync.instance = browsersync.init({     server: {       basedir: ['app'],       middleware: [         proxymiddleware,         modrewrite([           '^[^\\.]*$ /index.html [l]'         ])       ]     },   }); 

i set still doesnt work , 404 main url. clues on this?

what looking pathlocationstrategy default locationstrategy

note

when using need set server redirect all requests root url. example if user requests myapp.com/someroute assets resolved url incorrect. instead want server serve index.html page regardless of route specified, still keep route intact can used client-side application.

also sure set <base path="/" /> tag in head of html.


Comments

Popular posts from this blog

routing - AngularJS State management ->load multiple states in one page -

python - GRASS parser() error -

Swift game error message -