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 -

python - Error: Unresolved reference 'selenium' What is the reason? -

asp.net ajax - Jquery scroll to element just goes to top of page -