import { RouteReuseStrategy , DetachedRouteHandle , ActivatedRouteSnapshot } from '@angular/router' ; export class RebirthRouterReuseStrategy implements RouteReuseStrategy { handlers : { [ key ] : DetachedRouteHandle ; } = { } ; shouldDetach ( route ) { console . log ( 'RebirthRouterReuseStrategy:shouldDetach' , route ) ; return true ; } store ( route , handle ) { console . log ( 'RebirthRouterReuseStrategy:store' , route , handle ) ; this . handlers [ route . routeConfig . path ] = handle ; } shouldAttach ( route ) { console . log ( 'RebirthRouterReuseStrategy:shouldAttach' , route ) ; return ! ! route . routeConfig && ! ! this . handlers [ route . routeConfig . path ] ; } retrieve ( route ) { console . log ( 'RebirthRouterReuseStrategy:retrieve' , route ) ; return route . routeConfig ? this . handlers [ route . routeConfig . path ] : null ; } shouldReuseRoute ( future , current ) { console . log ( 'RebirthRouterReuseStrategy:shouldReuseRoute' , future , current ) ; return future . routeConfig === current . routeConfig ; } }