Angular 2: Route to default on refresh -


i wonder if possible tell angular 2 app redirect default route (localhost:8080/) on page refresh.

see example:

 localhost:8080/#/home    ---refresh action--->     localhost:8080/ 

one way turn off initialnavigation, import router module:

routermodule.forroot(app_routes, {initialnavigation: false}) 

and in constructor of root service or wherever inject router , navigate /.


Comments

Popular posts from this blog

javascript - Clear button on addentry page doesn't work -

c# - Selenium Authentication Popup preventing driver close or quit -

tensorflow when input_data MNIST_data , zlib.error: Error -3 while decompressing: invalid block type -