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
Post a Comment