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
booleanDetermines if this route (and its subtree) should be detached to be reused later
@returns
boolean
store
voidStores the detached route.
Storing a null value should erase the previously stored value.
@returns
void
shouldAttach
booleanDetermines if this route (and its subtree) should be reattached
@returns
boolean
retrieve
DetachedRouteHandle | nullRetrieves the previously stored route
@returns
DetachedRouteHandle | null
shouldReuseRoute
booleanDetermines if a route should be reused
@returns
boolean