Skip to content

Commit

Permalink
move row clear
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewseguin committed Jul 14, 2017
1 parent 15fae92 commit 982b0ba
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/cdk/table/table.ts
Original file line number Diff line number Diff line change
Expand Up @@ -215,10 +215,6 @@ export class CdkTable<T> implements CollectionViewer {
if (this.dataSource && !this._renderChangeSubscription) {
this._observeRenderChanges();
}

if (!this.dataSource && this._rowPlaceholder.viewContainer.length != 0) {
this._rowPlaceholder.viewContainer.clear();
}
}

/**
Expand All @@ -239,6 +235,11 @@ export class CdkTable<T> implements CollectionViewer {
this._renderChangeSubscription = null;
}

// Remove the table's rows if there is now no data source
if (!dataSource) {
this._rowPlaceholder.viewContainer.clear();
}

this._dataSource = dataSource;
}

Expand Down

0 comments on commit 982b0ba

Please sign in to comment.