I tried to use custom reuse strategy in my angular2 project, but I found it doesn\'t work with lazy module loading. Anyone who know about this? My project i
To make it work you should take into account the full path instead of simple route.routeConfig.path as most articles suggests. For example:
private getKey(route: ActivatedRouteSnapshot): string {
return route.pathFromRoot
.map((el: ActivatedRouteSnapshot) => el.routeConfig ? el.routeConfig.path : '')
.filter(str => str.length > 0)
.join('');
}
store(route: ActivatedRouteSnapshot, handle: DetachedRouteHandle): void {
this.handlers[this.getKey(route)] = handle;
}