fix(angular): compare router params length

This commit is contained in:
mhartington
2018-04-23 16:33:48 -04:00
parent d7a1bd40bc
commit b3a9c7f819

View File

@ -19,7 +19,12 @@ export class IonicRouteStrategy implements RouteReuseStrategy {
}
shouldReuseRoute(future: ActivatedRouteSnapshot, curr: ActivatedRouteSnapshot): boolean {
if (objectValues(future.params) && objectValues(curr.params)) {
// checking router params
const futureParams = objectValues(future.params);
const currParams = objectValues(curr.params);
if (futureParams && !!futureParams.length && currParams && currParams.length > 0) {
// If the router params do not match, render the new component
return deepEqual(future.params, curr.params);
} else {
return future.routeConfig === curr.routeConfig;