title: angular RouteReuseStrategy scroll position keep
body: <p>angular RouteReuseStrategy scroll position error.</p>
  
  <p>When I returned to the list page from another page, the scroll bar went back to the top</p>
  
  <pre><code>import {ActivatedRouteSnapshot, DetachedRouteHandle, RouteReuseStrategy} from '@angular/router';
  
  export class SystemRouteReuseStrategy implements RouteReuseStrategy {
  
    handlers: {[key: string]: DetachedRouteHandle} = {};
  
    shouldDetach(route: ActivatedRouteSnapshot): boolean {
      if (route.data.reuse) {
        return true;
      }
      return false;
    }
  
    store(route: ActivatedRouteSnapshot, handle: DetachedRouteHandle): void {
      this.handlers[route.routeConfig.path] = handle;
    }
  
    shouldAttach(route: ActivatedRouteSnapshot): boolean {
      return !!route.routeConfig &amp;&amp; !!this.handlers[route.routeConfig.path];
    }
  
    retrieve(route: ActivatedRouteSnapshot): DetachedRouteHandle {
      return this.handlers[route.routeConfig.path]; 
    }
  
    shouldReuseRoute(future: ActivatedRouteSnapshot, curr: ActivatedRouteSnapshot): boolean {
      return future.routeConfig === curr.routeConfig;
    }
  
  }
  
  </code></pre>