title: Angular 8. How to prevent route reset after a page refresh
body: <p>The route is reset after the page is refreshed
  This is the router module</p>
  
  <pre><code>const routes: Routes = [
    { path: '', component: LoginComponent },
    { path: 'login', component: LoginComponent },
    { path: 'home', component: HomeComponent, canActivate: [AuthGuard] },
    { path: 'parameters', component: ParametersDialogComponent },
    { path: 'report1', component: Report1Component, canActivate: [AuthGuard] },
    { path: 'report2', component: Report2Component, canActivate: [AuthGuard] },
    { path: '**', redirectTo: 'login', pathMatch: 'full'}
  </code></pre>
  
  <p>Login</p>
  
  <pre><code>Router Event: NavigationStart
  platform-browser.js:292 NavigationStart(id: 4, url: '/home')
  platform-browser.js:292 NavigationStart {id: 4, url: "/home", navigationTrigger: "imperative", restoredState: null}
  platform-browser.js:301 Router Event: RoutesRecognized
  platform-browser.js:292 RoutesRecognized(id: 4, url: '/home', urlAfterRedirects: '/home', state: Route(url:'', path:'') { Route(url:'home', path:'home') } )
  </code></pre>
  
  <p>Current route is localhost:4200/home</p>
  
  <p>after refreshing I got:</p>
  
  <pre><code>Router Event: NavigationStart
  platform-browser.js:292 NavigationStart(id: 1, url: '/')
  platform-browser.js:292 NavigationStart {id: 1, url: "/", navigationTrigger: "imperative", restoredState: null}
  </code></pre>
  
  <p>and redirects to login page </p>
  
  <p>How to prevent this?</p>