66 * found in the LICENSE file at https://angular.io/license
77 */
88
9- import { Inject , Injectable , OnDestroy , Provider , CSP_NONCE , Optional } from '@angular/core' ;
9+ import { Injectable , OnDestroy , Provider , CSP_NONCE , inject } from '@angular/core' ;
1010import { DOCUMENT } from '@angular/common' ;
1111import { coerceCssPixelValue } from '@angular/cdk/coercion' ;
1212import { CdkTable , _CoalescedStyleScheduler , _COALESCED_STYLE_SCHEDULER } from '@angular/cdk/table' ;
@@ -77,14 +77,9 @@ export abstract class ResizeStrategy {
7777 */
7878@Injectable ( )
7979export class TableLayoutFixedResizeStrategy extends ResizeStrategy {
80- constructor (
81- protected readonly columnResize : ColumnResize ,
82- @Inject ( _COALESCED_STYLE_SCHEDULER )
83- protected readonly styleScheduler : _CoalescedStyleScheduler ,
84- protected readonly table : CdkTable < unknown > ,
85- ) {
86- super ( ) ;
87- }
80+ protected readonly columnResize = inject ( ColumnResize ) ;
81+ protected readonly styleScheduler = inject < _CoalescedStyleScheduler > ( _COALESCED_STYLE_SCHEDULER ) ;
82+ protected readonly table = inject < CdkTable < unknown > > ( CdkTable ) ;
8883
8984 applyColumnSize (
9085 _ : string ,
@@ -128,7 +123,12 @@ export class TableLayoutFixedResizeStrategy extends ResizeStrategy {
128123 */
129124@Injectable ( )
130125export class CdkFlexTableResizeStrategy extends ResizeStrategy implements OnDestroy {
131- private readonly _document : Document ;
126+ protected readonly columnResize = inject ( ColumnResize ) ;
127+ protected readonly styleScheduler = inject < _CoalescedStyleScheduler > ( _COALESCED_STYLE_SCHEDULER ) ;
128+ protected readonly table = inject < CdkTable < unknown > > ( CdkTable ) ;
129+ private readonly _nonce = inject ( CSP_NONCE , { optional : true } ) ;
130+
131+ private readonly _document = inject ( DOCUMENT ) ;
132132 private readonly _columnIndexes = new Map < string , number > ( ) ;
133133 private readonly _columnProperties = new Map < string , Map < string , string > > ( ) ;
134134
@@ -138,18 +138,6 @@ export class CdkFlexTableResizeStrategy extends ResizeStrategy implements OnDest
138138 protected readonly defaultMinSize = 0 ;
139139 protected readonly defaultMaxSize = Number . MAX_SAFE_INTEGER ;
140140
141- constructor (
142- protected readonly columnResize : ColumnResize ,
143- @Inject ( _COALESCED_STYLE_SCHEDULER )
144- protected readonly styleScheduler : _CoalescedStyleScheduler ,
145- protected readonly table : CdkTable < unknown > ,
146- @Inject ( DOCUMENT ) document : any ,
147- @Inject ( CSP_NONCE ) @Optional ( ) private readonly _nonce ?: string | null ,
148- ) {
149- super ( ) ;
150- this . _document = document ;
151- }
152-
153141 applyColumnSize (
154142 cssFriendlyColumnName : string ,
155143 columnHeader : HTMLElement ,
0 commit comments