angular / angular/components

[Table] Error when using ng-content

Open
#6,980 17 comments 13 reactions 0 assignees View on GitHub
area: material/table P3
Dominant language
TypeScript
Stars
25k
Forks
6.8k
Avg merge
1d 8h
Merged PRs (30d)
91

Description

#### 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`

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the failure in the linked Plunker with ng-content inside md-table, then trace when md-table accesses getColumnsDiff relative to projected content replacement. Done means md-table waits for the projected content and no longer throws the undefined-property error when used inside a configurable component.

Written by the indexing model from the issue text.

Assessment

Tech stack
angular, typescript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
58/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.