From 58c32a737be785a2bdc2954d24eee3369b58050a Mon Sep 17 00:00:00 2001 From: sinedied Date: Tue, 12 Jan 2021 16:03:26 +0100 Subject: [PATCH] refactor: clean up reuse tag (#576) --- .../app/templates/src/app/@core/route-reusable-strategy.ts | 6 +++--- generators/app/templates/src/app/shell/_shell.service.ts | 4 +--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/generators/app/templates/src/app/@core/route-reusable-strategy.ts b/generators/app/templates/src/app/@core/route-reusable-strategy.ts index d4ea59ac..176f1cd9 100644 --- a/generators/app/templates/src/app/@core/route-reusable-strategy.ts +++ b/generators/app/templates/src/app/@core/route-reusable-strategy.ts @@ -23,12 +23,12 @@ export class RouteReusableStrategy extends RouteReuseStrategy { return null; } - public shouldReuseRoute(curr: ActivatedRouteSnapshot, future: ActivatedRouteSnapshot): boolean { + public shouldReuseRoute(future: ActivatedRouteSnapshot, curr: ActivatedRouteSnapshot): boolean { // Reuse the route if the RouteConfig is the same, or if both routes use the // same component, because the latter can have different RouteConfigs. return future.routeConfig === curr.routeConfig || - (!!future.routeConfig?.component && - future.routeConfig?.component === curr.routeConfig?.component); + (future.routeConfig?.component && + future.routeConfig?.component === curr.routeConfig?.component); } } diff --git a/generators/app/templates/src/app/shell/_shell.service.ts b/generators/app/templates/src/app/shell/_shell.service.ts index 8fb10382..986b2210 100644 --- a/generators/app/templates/src/app/shell/_shell.service.ts +++ b/generators/app/templates/src/app/shell/_shell.service.ts @@ -21,10 +21,8 @@ export class Shell { component: ShellComponent, children: routes, <% if (props.auth) { -%> - canActivate: [AuthenticationGuard], + canActivate: [AuthenticationGuard] <% } -%> - // Reuse ShellComponent instance when navigating between child views - data: { reuse: true } }; } }