On this page
RouteReuseStrategy
class
Provides a way to customize when activated routes get reused.
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
}
Methods
shouldDetach()
|
||
---|---|---|
Determines if this route (and its subtree) should be detached to be reused later |
||
|
route | Type: |
Returns
boolean
store()
|
||||
---|---|---|---|---|
Stores the detached route. |
||||
|
route | Type: |
handle | Type: |
Returns
void
Storing a null
value should erase the previously stored value.
shouldAttach()
|
||
---|---|---|
Determines if this route (and its subtree) should be reattached |
||
|
route | Type: |
Returns
boolean
retrieve()
|
||
---|---|---|
Retrieves the previously stored route |
||
|
route | Type: |
Returns
DetachedRouteHandle | null
shouldReuseRoute()
|
||||
---|---|---|---|---|
Determines if a route should be reused |
||||
|
future | Type: |
curr | Type: |
Returns
boolean
© 2010–2019 Google, Inc.
Licensed under the Creative Commons Attribution License 4.0.
https://v6.angular.io/api/router/RouteReuseStrategy