angular / angular/components

[Table] Error when using ng-content

オープン
#6,980 コメント 17 件 リアクション 13 件 担当者 0 名 GitHub で見る
area: material/table P3
主要言語
TypeScript
スター
25k
フォーク
6.8k
平均マージ
1日 8時間
マージ済み PR(30日)
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 プロパティのエラーをスローしなくなれば完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
angular, typescript
領域
frontend
issue の種類
バグ
難易度
3/5
見積もり時間
1〜2日
活発さ
静か
明瞭さ
おおむね明確
初心者へのやさしさ
58/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。