RouteReuseStrategy

class

npm Package @angular/router
Module import { RouteReuseStrategy } from '@angular/router';
Source router/src/route_reuse_strategy.ts

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–2017 Google, Inc.
Licensed under the Creative Commons Attribution License 4.0.
https://v4.angular.io/api/router/RouteReuseStrategy