• Overview
@angular/router

RouteReuseStrategy

Class
stable

Provides a way to customize when activated routes get reused.

API

    
      abstract class RouteReuseStrategy {}
    
    

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

retrieveStoredRouteHandles

DetachedRouteHandle[]

Returns a list of all currently stored DetachedRouteHandles.

This method is called by the router after navigations to identify which injectors are still needed by detached routes.

shouldDestroyInjector

boolean

Determines if the injector for the given route should be destroyed.

If this method returns true, the router will destroy the injector for the given route.

@paramrouteRoute
@returnsboolean
Jump to details