From 74175f84ea1892cdf6e584d80297cc4c5dd6f6f6 Mon Sep 17 00:00:00 2001 From: Andrew Scott Date: Fri, 8 Jan 2021 16:32:25 -0800 Subject: [PATCH] fix(router): Remove usage of `Object.values` to avoid the need for a polyfill (#40370) `Object.values` is not supported in IE11 without a polyfill. The quickest, most straightfoward fix for this is to simply use `Object.keys` instead. We may want to consider including the polyfill in the CLI in the future or just wait until IE11 support is dropped before using `Object.values`. PR Close #40370 --- packages/router/src/operators/activate_routes.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/router/src/operators/activate_routes.ts b/packages/router/src/operators/activate_routes.ts index f62ec645a4..094da9649c 100644 --- a/packages/router/src/operators/activate_routes.ts +++ b/packages/router/src/operators/activate_routes.ts @@ -114,8 +114,8 @@ export class ActivateRoutes { const contexts = context && route.value.component ? context.children : parentContexts; const children: {[outletName: string]: TreeNode} = nodeChildrenAsMap(route); - for (const child of Object.values(children)) { - this.deactivateRouteAndItsChildren(child, contexts); + for (const childOutlet of Object.keys(children)) { + this.deactivateRouteAndItsChildren(children[childOutlet], contexts); } if (context && context.outlet) {