Skip to content

Commit 7b21563

Browse files
committed
fix(vhelper): use inject api
1 parent f0101f4 commit 7b21563

File tree

3 files changed

+11
-17
lines changed

3 files changed

+11
-17
lines changed

projects/igniteui-angular/src/lib/directives/for-of/base.helper.component.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ import {
88
Inject,
99
NgZone,
1010
Renderer2,
11-
PLATFORM_ID
11+
PLATFORM_ID,
12+
inject
1213
} from '@angular/core';
1314
import { DOCUMENT } from '@angular/common';
1415
import { Subject } from 'rxjs';
@@ -30,16 +31,16 @@ export class VirtualHelperBaseDirective implements OnDestroy, AfterViewInit {
3031
private _afterViewInit = false;
3132
private _scrollNativeSize: number;
3233
private _detached = false;
34+
protected renderer = inject(Renderer2);
35+
protected platformId = inject(PLATFORM_ID);
36+
protected ngZone = inject(NgZone);
3337

3438
constructor(
3539
public elementRef: ElementRef<HTMLElement>,
3640
public cdr: ChangeDetectorRef,
3741
protected _zone: NgZone,
3842
@Inject(DOCUMENT) public document: any,
39-
protected platformUtil: PlatformUtil,
40-
private renderer: Renderer2,
41-
@Inject(PLATFORM_ID) private platformId: Object,
42-
private ngZone: NgZone
43+
protected platformUtil: PlatformUtil
4344
) {
4445
this._scrollNativeSize = this.calculateScrollNativeSize();
4546
}

projects/igniteui-angular/src/lib/directives/for-of/horizontal.virtual.helper.component.ts

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Component, ElementRef, HostBinding, Input, ViewChild, ViewContainerRef, ChangeDetectorRef, Inject, NgZone, Renderer2, PLATFORM_ID } from '@angular/core';
1+
import { Component, ElementRef, HostBinding, Input, ViewChild, ViewContainerRef, ChangeDetectorRef, Inject, NgZone } from '@angular/core';
22
import { VirtualHelperBaseDirective } from './base.helper.component';
33
import { DOCUMENT } from '@angular/common';
44
import { PlatformUtil } from '../../core/utils';
@@ -24,12 +24,9 @@ export class HVirtualHelperComponent extends VirtualHelperBaseDirective {
2424
cdr: ChangeDetectorRef,
2525
zone: NgZone,
2626
@Inject(DOCUMENT) document: any,
27-
platformUtil: PlatformUtil,
28-
renderer: Renderer2,
29-
@Inject(PLATFORM_ID) platformId: Object,
30-
ngZone: NgZone
27+
platformUtil: PlatformUtil
3128
) {
32-
super(elementRef, cdr, zone, document, platformUtil, renderer, platformId, ngZone);
29+
super(elementRef, cdr, zone, document, platformUtil);
3330
}
3431

3532
protected override restoreScroll() {

projects/igniteui-angular/src/lib/directives/for-of/virtual.helper.component.ts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { Component, ElementRef, HostBinding, Input, ViewChild, ViewContainerRef,
2-
ChangeDetectorRef, OnDestroy, OnInit, Inject, NgZone, Renderer2,
3-
PLATFORM_ID} from '@angular/core';
2+
ChangeDetectorRef, OnDestroy, OnInit, Inject, NgZone} from '@angular/core';
43
import { VirtualHelperBaseDirective } from './base.helper.component';
54
import { DOCUMENT } from '@angular/common';
65
import { PlatformUtil } from '../../core/utils';
@@ -28,11 +27,8 @@ export class VirtualHelperComponent extends VirtualHelperBaseDirective implement
2827
zone: NgZone,
2928
@Inject(DOCUMENT) document: any,
3029
platformUtil: PlatformUtil,
31-
renderer: Renderer2,
32-
@Inject(PLATFORM_ID) platformId: Object,
33-
ngZone: NgZone
3430
) {
35-
super(elementRef, cdr, zone, document, platformUtil, renderer, platformId, ngZone);
31+
super(elementRef, cdr, zone, document, platformUtil);
3632
}
3733

3834
public ngOnInit() {

0 commit comments

Comments
 (0)