9
9
import {
10
10
ChangeDetectionStrategy ,
11
11
Component ,
12
- Directive , IterableChanges ,
12
+ Directive ,
13
+ IterableChanges ,
13
14
IterableDiffer ,
14
15
IterableDiffers ,
15
16
SimpleChanges ,
16
17
TemplateRef ,
17
18
ViewContainerRef
18
19
} from '@angular/core' ;
19
20
import { CdkCellDef } from './cell' ;
20
- import { Subject } from 'rxjs/Subject' ;
21
21
22
22
/**
23
23
* The row template that can be used by the md-table. Should not be used outside of the
@@ -34,16 +34,16 @@ export abstract class BaseRowDef {
34
34
columns : string [ ] ;
35
35
36
36
/** Differ used to check if any changes were made to the columns. */
37
- columnsDiffer : IterableDiffer < any > ;
37
+ protected _columnsDiffer : IterableDiffer < any > ;
38
38
39
39
constructor ( public template : TemplateRef < any > ,
40
40
protected _differs : IterableDiffers ) { }
41
41
42
42
ngOnChanges ( changes : SimpleChanges ) : void {
43
43
// Create a new columns differ if one does not yet exist. Initialize it based on initial value
44
44
// of the columns property.
45
- if ( ! this . columnsDiffer && changes [ 'columns' ] . currentValue ) {
46
- this . columnsDiffer = this . _differs . find ( changes [ 'columns' ] . currentValue ) . create ( ) ;
45
+ if ( ! this . _columnsDiffer && changes [ 'columns' ] . currentValue ) {
46
+ this . _columnsDiffer = this . _differs . find ( changes [ 'columns' ] . currentValue ) . create ( ) ;
47
47
}
48
48
}
49
49
@@ -52,7 +52,7 @@ export abstract class BaseRowDef {
52
52
* if there is no difference.
53
53
*/
54
54
getColumnsDiff ( ) : IterableChanges < any > | null {
55
- return this . columnsDiffer . diff ( this . columns ) ;
55
+ return this . _columnsDiffer . diff ( this . columns ) ;
56
56
}
57
57
}
58
58
0 commit comments