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
This commit is contained in:
Andrew Scott 2021-01-08 16:32:25 -08:00
parent 6a9e328432
commit 74175f84ea
1 changed files with 2 additions and 2 deletions

View File

@ -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) {