Skip to content

bug(data-table): data source connect not called when using router #5593

@benb7760

Description

@benb7760

Bug, feature request, or proposal:

I have copied the exact demo from 'material-examples' into a plunker and have loaded the TableBasicExample component via a router. When navigating to the router (via button in toolbar on plunkr), the table does not display correctly. When clicking that button again, it works. In my own application I have tested by including logging in the connect() method of the data source. It does not get called on initial navigation to the route, but it does when you navigate the second time

One resolution I have used is to perform the dataSource initialization in a setTimeout(1), which solves the issue, but I do not believe that this should be the solution.

What is the expected behavior?

The data source connect method should be called after navigating to page via router

What is the current behavior?

The data source connect method is not called

What are the steps to reproduce?

http://plnkr.co/edit/RRVoUV9SBAxozY6VhvpA?p=preview

Which versions of Angular, Material, OS, TypeScript, browsers are affected?

latest master, and beta8

Metadata

Metadata

Assignees

Labels

P3An issue that is relevant to core functions, but does not impede progress. Important, but not urgent

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions