angular / angular/components

tree.treeControl.expandAll() has an error

未关闭
#12,469 18 条评论 24 个 reaction 已指派 0 人 在 GitHub 查看
area: material/tree needs: discussion P3
主要语言
TypeScript
星标
25k
派生
6.8k
平均合并
1 天 8 小时
30 天内合并 PR
91

描述

#### Bug
Dear team!
I has an error when I want to expand all node of Mat nested tree
```
ERROR TypeError: Cannot read property 'reduce' of undefined
at NestedTreeControl.push../node_modules/@angular/cdk/esm5/tree.es5.js.NestedTreeControl.expandAll (tree.es5.js:287)
at Object.eval [as handleEvent] (FilterViewComponent.html:18)
at handleEvent (core.js:10050)
at callWithDebugContext (core.js:11143)
at Object.debugHandleEvent [as handleEvent] (core.js:10846)
at dispatchEvent (core.js:7509)
at core.js:7953
at HTMLButtonElement. (platform-browser.js:1140)
at ZoneDelegate.push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invokeTask (zone.js:421)
at Object.onInvokeTask (core.js:3748)
```

#### Which versions of Angular, Material, OS, TypeScript, browsers are affected?
Angular 6.1.0
Material 6.4.1

贡献指南

打开贡献指南

调研方向

首先使用 FilterViewComponent.html 中所示的调用,在 Angular 6.1.0 和 Material 6.4.1 下重现 NestedTreeControl.expandAll 中的失败。检查 tree.es5.js 中报告位置附近的嵌套树实现,并确定 reduce 为什么会接收到 undefined;当 expandAll 能够无错误地展开所有嵌套节点,并且具有回归测试覆盖时,即表示完成。

由索引模型根据 Issue 内容生成。

评估

技术栈
angular, typescript
领域
frontend
Issue 类型
缺陷
难度
3/5
预计耗时
1-2 天
活跃度
停滞
描述清晰度
需要澄清
新手友好度
35/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。