Skip to content

Commit

Permalink
fix connect function v2
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewseguin committed Jan 31, 2018
1 parent 9b03212 commit 36f6aff
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/cdk/table/table.ts
Original file line number Diff line number Diff line change
Expand Up @@ -426,9 +426,8 @@ export class CdkTable<T> implements CollectionViewer, OnInit, AfterContentChecke
// Cannot check this.dataSource['connect'] due to potential property renaming, nor can it
// checked as an instanceof DataSource<T> since the table should allow for data sources
// that did not explicitly extend DataSource<T>.
const connectFunction = (this.dataSource as DataSource<T>).connect;
if (connectFunction instanceof Function) {
dataStream = connectFunction(this);
if ((this.dataSource as DataSource<T>).connect instanceof Function) {
dataStream = (this.dataSource as DataSource<T>).connect(this);
} else if (this.dataSource instanceof Observable) {
dataStream = this.dataSource;
} else if (Array.isArray(this.dataSource)) {
Expand Down

0 comments on commit 36f6aff

Please sign in to comment.