Skip to content

Commit 9beeaaa

Browse files
committed
rebase
1 parent 40dad50 commit 9beeaaa

File tree

2 files changed

+3
-28
lines changed

2 files changed

+3
-28
lines changed

src/cdk/table/table.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import {CdkTableModule} from './index';
99
import {map} from 'rxjs/operator/map';
1010
import {getTableDuplicateColumnNameError, getTableUnknownColumnError} from './table-errors';
1111

12-
describe('CdkTable', () => {
12+
fdescribe('CdkTable', () => {
1313
let fixture: ComponentFixture<SimpleCdkTableApp>;
1414

1515
let component: SimpleCdkTableApp;

src/cdk/table/table.ts

Lines changed: 2 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,6 @@ export class CdkTable<T> implements CollectionViewer {
152152

153153
constructor(private readonly _differs: IterableDiffers,
154154
private readonly _changeDetectorRef: ChangeDetectorRef,
155-
private readonly _ngZone: NgZone,
156155
elementRef: ElementRef,
157156
renderer: Renderer2,
158157
@Attribute('role') role: string) {
@@ -166,26 +165,13 @@ export class CdkTable<T> implements CollectionViewer {
166165
this._dataDiffer = this._differs.find([]).create(this._trackByFn);
167166
}
168167

169-
ngDoCheck() {
170-
// After the the content and view have been initialized and checked then we can connect
171-
// to the data source and render data rows. This cannot be done from within change detection,
172-
// so the table must wait until the next change detection cycle before rendering.
173-
if (this._isViewInitialized && this.dataSource && !this._renderChangeSubscription) {
174-
this._observeRenderChanges();
175-
}
176-
}
177-
178168
ngAfterContentInit() {
179169
this._cacheColumnDefinitionsByName();
180170
this._columnDefinitions.changes.subscribe(() => this._cacheColumnDefinitionsByName());
181171
}
182172

183173
ngAfterContentChecked() {
184174
this._renderUpdatedColumns();
185-
this._cacheColumnDefinitionsByName();
186-
}
187-
188-
ngAfterViewInit() {
189175
if (this.dataSource && !this._renderChangeSubscription) {
190176
this._observeRenderChanges();
191177
}
@@ -202,17 +188,6 @@ export class CdkTable<T> implements CollectionViewer {
202188
}
203189
}
204190

205-
ngAfterContentInit() {
206-
// TODO(andrewseguin): Throw an error if two columns share the same name
207-
this._columnDefinitions.forEach(columnDef => {
208-
this._columnDefinitionsByName.set(columnDef.name, columnDef);
209-
});
210-
211-
if (this.dataSource && !this._renderChangeSubscription) {
212-
this._observeRenderChanges();
213-
}
214-
}
215-
216191

217192
/** Update the map containing the content's column definitions. */
218193
private _cacheColumnDefinitionsByName() {
@@ -231,8 +206,8 @@ export class CdkTable<T> implements CollectionViewer {
231206
*/
232207
private _renderUpdatedColumns() {
233208
// Re-render the rows when the row definition columns change.
234-
this._rowDefinitions.forEach(def => {
235-
if (!!def.getColumnsDiff()) {
209+
this._rowDefinitions.forEach(rowDefinition => {
210+
if (!!rowDefinition.getColumnsDiff()) {
236211
// Reset the data to an empty array so that renderRowChanges will re-render all new rows.
237212
this._dataDiffer.diff([]);
238213

0 commit comments

Comments
 (0)