7
7
*/
8
8
9
9
import {
10
+ ChangeDetectionStrategy ,
10
11
Component ,
11
12
Inject ,
12
13
InjectionToken ,
@@ -15,9 +16,9 @@ import {
15
16
OnInit ,
16
17
Optional ,
17
18
ViewChild ,
18
- ChangeDetectionStrategy ,
19
19
ViewEncapsulation
20
20
} from '@angular/core' ;
21
+
21
22
import { CdkColumnDef } from './cell' ;
22
23
import { CdkTable } from './table' ;
23
24
import { getTableTextColumnMissingParentTableError } from './table-errors' ;
@@ -36,7 +37,7 @@ export interface TextColumnOptions<T> {
36
37
37
38
/** Injection token that can be used to specify the text column options. */
38
39
export const TEXT_COLUMN_OPTIONS =
39
- new InjectionToken < TextColumnOptions < any > > ( 'text-column-options' ) ;
40
+ new InjectionToken < TextColumnOptions < any > > ( 'text-column-options' ) ;
40
41
41
42
/**
42
43
* Column that simply shows text content for the header and row cells. Assumes that the table
@@ -72,7 +73,9 @@ export const TEXT_COLUMN_OPTIONS =
72
73
export class CdkTextColumn < T > implements OnDestroy , OnInit {
73
74
/** Column name that should be used to reference this column. */
74
75
@Input ( )
75
- get name ( ) : string { return this . _name ; }
76
+ get name ( ) : string {
77
+ return this . _name ;
78
+ }
76
79
set name ( name : string ) {
77
80
this . _name = name ;
78
81
this . columnDef . name = name ;
@@ -94,12 +97,13 @@ export class CdkTextColumn<T> implements OnDestroy, OnInit {
94
97
@Input ( ) dataAccessor : ( data : T , name : string ) => string ;
95
98
96
99
/** Alignment of the cell values. */
97
- @Input ( ) justify : 'start' | 'end' = 'start' ;
100
+ @Input ( ) justify : 'start' | 'end' = 'start' ;
98
101
99
102
@ViewChild ( CdkColumnDef ) columnDef : CdkColumnDef ;
100
103
101
- constructor ( @Optional ( ) private table : CdkTable < T > ,
102
- @Optional ( ) @Inject ( TEXT_COLUMN_OPTIONS ) private options : TextColumnOptions < T > ) {
104
+ constructor (
105
+ @Optional ( ) private table : CdkTable < T > ,
106
+ @Optional ( ) @Inject ( TEXT_COLUMN_OPTIONS ) private options : TextColumnOptions < T > ) {
103
107
this . options = options || { } ;
104
108
}
105
109
@@ -109,8 +113,8 @@ export class CdkTextColumn<T> implements OnDestroy, OnInit {
109
113
}
110
114
111
115
if ( ! this . dataAccessor ) {
112
- this . dataAccessor = this . options . defaultDataAccessor ||
113
- ( ( data : T , name : string ) => ( data as any ) [ name ] ) ;
116
+ this . dataAccessor =
117
+ this . options . defaultDataAccessor || ( ( data : T , name : string ) => ( data as any ) [ name ] ) ;
114
118
}
115
119
116
120
if ( this . table ) {
0 commit comments