Skip to content

Conversation

andrewseguin
Copy link
Contributor

Seeing errors in tables that define their columns after the table's content has been initialized. Column input to row definitions should default to an empty array.

Workaround for issue: Initialize column input as an empty array.

Fixes #6831

@googlebot googlebot added the cla: yes PR author has agreed to Google's Contributor License Agreement label Sep 5, 2017
Copy link
Member

@jelbourn jelbourn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jelbourn jelbourn added pr: lgtm action: merge The PR is ready for merge by the caretaker and removed pr: needs review labels Sep 6, 2017
@leibale
Copy link
Contributor

leibale commented Sep 10, 2017

@andrewseguin @jelbourn How can i use this PR now (without waiting for merge)? Thanks

@andrewseguin
Copy link
Contributor Author

@leibale In the meantime, be sure to initialize your columns to an empty array. This error appears when columns are set to null or undefined when provided to the table.

This will error:

export class MyTable {
  myColumns: string[];
}

To fix, initialize myColumns as an empty array.

export class MyTable {
  myColumns: string[] = [];
}

@leibale
Copy link
Contributor

leibale commented Sep 11, 2017

@andrewseguin I thought your PR resolving my issue (#6980) but it isn't the same issue at all..

@andrewseguin andrewseguin added the P1 Impacts a large percentage of users; if a workaround exists it is partial or overly painful label Sep 14, 2017
@jelbourn jelbourn merged commit 3ddf65b into angular:master Sep 20, 2017
@andrewseguin andrewseguin deleted the table-empty-columns branch November 28, 2017 20:40
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 7, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

action: merge The PR is ready for merge by the caretaker cla: yes PR author has agreed to Google's Contributor License Agreement P1 Impacts a large percentage of users; if a workaround exists it is partial or overly painful

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Table] Uninitialized columns cause error in table

4 participants