angular / angular/components

[Table] Error when using ng-content

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

描述

#### Bug, feature request, or proposal:
Bug

#### What is the expected behavior?
`md-table` should wait until the `ng-content` replaced.

#### What is the current behavior?
`md-table` throws ` Cannot read property 'getColumnsDiff' of undefined`.

#### What are the steps to reproduce?
Put `ng-content` inside `md-table`.

https://plnkr.co/edit/RpOncq9lbwPcjAGjXSyR?p=preview

#### What is the use-case or motivation for changing an existing behavior?
Anyone that want to create a component with configurable `md-table` inside cannot do it.

#### Which versions of Angular, Material, OS, TypeScript, browsers are affected?
Angular: `4.4.0-RC.0` in the plunker, but this is not working with any version.
Material: `2.0.0-beta.10`

贡献指南

打开贡献指南

调研方向

首先,在链接的 Plunker 中重现 ng-content 位于 md-table 内部时的故障,然后跟踪 md-table 相对于投影内容替换访问 getColumnsDiff 的时机。当 md-table 等待投影内容,并且在可配置组件内部使用时不再抛出 undefined-property 错误时,即表示完成。

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

评估

技术栈
angular, typescript
领域
frontend
Issue 类型
缺陷
难度
3/5
预计耗时
1-2 天
活跃度
冷清
描述清晰度
基本清楚
新手友好度
58/100

把新 issue 发到你的邮箱

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