mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-17 18:54:11 +08:00
fix(angular): compare router params length
This commit is contained in:
@ -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;
|
||||
|
Reference in New Issue
Block a user