Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Table] CdkTable doesn't automatically connect to data source when using OnPush #5914

Closed
willshowell opened this issue Jul 20, 2017 · 2 comments · Fixed by #5775
Closed

[Table] CdkTable doesn't automatically connect to data source when using OnPush #5914

willshowell opened this issue Jul 20, 2017 · 2 comments · Fixed by #5775
Assignees

Comments

@willshowell
Copy link
Contributor

Bug, feature request, or proposal:

Bug

Current behavior

dataSource.connect() is not subscribed to until the second ngDoCheck hook, which must be triggered manually when using OnPush in the parent component.

Expected behavior

Data source is connected as soon as possible, not requiring an extra check

Workaround

constructor(private cd: ChangeDetectorRef) { }

ngOnInit() {
  this.dataSource = new ExampleDataSource(this.exampleDatabase);
  setTimeout(() => this.cd.markForCheck());
}

What are the steps to reproduce?

Reproduction: https://plnkr.co/edit/ACvDB3mUsNIIyOC16vpu?p=preview
Workaround: https://plnkr.co/edit/4p0pnAvmfYjIwWMXSqud?p=preview

@willshowell willshowell changed the title [Table] CdkTable never connects to data source when using OnPush [Table] CdkTable doesn't automatically connect to data source when using OnPush Jul 20, 2017
@andrewseguin
Copy link
Contributor

Thanks Will, we've got a PR open that will resolve this - #5775. This was similar to the issue we were having with router changes not rendering the table.

@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 6, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants