Skip to content

Commit

Permalink
fix(router): Remove usage of Object.values to avoid the need for a …
Browse files Browse the repository at this point in the history
…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
  • Loading branch information
atscott committed Jan 10, 2021
1 parent 5319eea commit c44dd84
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/router/src/operators/activate_routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,8 @@ export class ActivateRoutes {
const contexts = context && route.value.component ? context.children : parentContexts;
const children: {[outletName: string]: TreeNode<ActivatedRoute>} = 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) {
Expand Down

0 comments on commit c44dd84

Please sign in to comment.