W3cubDocs

/Angular

RouteReuseStrategy

Provides a way to customize when activated routes get reused.

API

abstract class RouteReuseStrategy {
  abstract shouldDetach(route: ActivatedRouteSnapshot): boolean;
  abstract store(route: ActivatedRouteSnapshot, handle: DetachedRouteHandle | null): void;
  abstract shouldAttach(route: ActivatedRouteSnapshot): boolean;
  abstract retrieve(route: ActivatedRouteSnapshot): DetachedRouteHandle | null;
  abstract shouldReuseRoute(future: ActivatedRouteSnapshot, curr: ActivatedRouteSnapshot): boolean;
}

shouldDetach

boolean

Determines if this route (and its subtree) should be detached to be reused later

@returnsboolean

store

void

Stores the detached route.

Storing a null value should erase the previously stored value.

@paramhandleDetachedRouteHandle | null
@returnsvoid

shouldAttach

boolean

Determines if this route (and its subtree) should be reattached

@returnsboolean

retrieve

DetachedRouteHandle | null

Retrieves the previously stored route

@returnsDetachedRouteHandle | null

shouldReuseRoute

boolean

Determines if a route should be reused

@returnsboolean

Super-powered by Google ©2010–2025.
Code licensed under an MIT-style License. Documentation licensed under CC BY 4.0.
https://angular.dev/api/router/RouteReuseStrategy