angular / 5 / api / router / routereusestrategy.html

RouteReuseStrategy

class

Provides a way to customize when activated routes get reused.

Overview

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

Members

shouldDetach(route: ActivatedRouteSnapshot): boolean

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

store(route: ActivatedRouteSnapshot, handle: DetachedRouteHandle | null): void

Stores the detached route.

Storing a null value should erase the previously stored value.

shouldAttach(route: ActivatedRouteSnapshot): boolean

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

retrieve(route: ActivatedRouteSnapshot): DetachedRouteHandle | null

Retrieves the previously stored route

shouldReuseRoute(future: ActivatedRouteSnapshot, curr: ActivatedRouteSnapshot): boolean

Determines if a route should be reused

© 2010–2018 Google, Inc.
Licensed under the Creative Commons Attribution License 4.0.
https://v5.angular.io/api/router/RouteReuseStrategy