@@ -76,7 +76,7 @@ export class CdkTable<T> implements CollectionViewer {
76
76
new BehaviorSubject < { start : number , end : number } > ( { start : 0 , end : Number . MAX_VALUE } ) ;
77
77
78
78
/** Stream that emits when a row def has a change to its array of columns to render. */
79
- columnsChange = new Observable < void [ ] > ( ) ;
79
+ _columnsChange = new Observable < void > ( ) ;
80
80
81
81
/**
82
82
* Map of all the user's defined columns identified by name.
@@ -131,23 +131,24 @@ export class CdkTable<T> implements CollectionViewer {
131
131
132
132
// Get and merge the streams for column changes made to the row defs
133
133
const rowDefs = [ ...this . _rowDefinitions . toArray ( ) , this . _headerDefinition ] ;
134
- const columnChangeStreams = rowDefs . map ( ( rowDef : BaseRowDef ) => rowDef . columnsChange ) ;
135
- this . columnsChange = Observable . combineLatest ( columnChangeStreams ) ;
134
+ const columnChangeStreams =
135
+ rowDefs . map ( ( rowDef : BaseRowDef ) => rowDef . columnsChange ) ;
136
+ this . _columnsChange = Observable . merge ( ...columnChangeStreams ) ;
136
137
}
137
138
138
139
ngAfterViewInit ( ) {
139
140
this . renderHeaderRow ( ) ;
140
141
141
142
// Re-render the header row if the columns changed.
142
- this . columnsChange . subscribe ( ( ) => {
143
+ this . _columnsChange . subscribe ( ( ) => {
143
144
this . _headerRowPlaceholder . viewContainer . clear ( ) ;
144
145
this . renderHeaderRow ( ) ;
145
146
} ) ;
146
147
147
148
// TODO(andrewseguin): If the data source is not
148
149
// present after view init, connect it when it is defined.
149
150
// TODO(andrewseguin): Unsubscribe from this on destroy.
150
- const streams = [ this . dataSource . connect ( this ) , this . columnsChange ] ;
151
+ const streams = [ this . dataSource . connect ( this ) , this . _columnsChange ] ;
151
152
Observable . combineLatest ( streams ) . subscribe ( ( [ rowsData ] ) => {
152
153
this . renderRowChanges ( rowsData ) ;
153
154
} ) ;
0 commit comments