Skip to content

Commit a3f54b7

Browse files
authored
Update resizable.directive.ts
1 parent bfdcb7b commit a3f54b7

1 file changed

Lines changed: 7 additions & 11 deletions

File tree

projects/angular-resizable-element/src/lib/resizable.directive.ts

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import {
1010
NgZone,
1111
PLATFORM_ID,
1212
inject,
13-
PLATFORM_ID,
1413
RendererFactory2
1514
} from '@angular/core';
1615
import {DOCUMENT, isPlatformBrowser} from '@angular/common';
@@ -301,23 +300,20 @@ export class ResizableDirective implements OnInit, OnDestroy {
301300

302301
private zone = inject(NgZone);
303302

303+
private rendererFactory = inject(RendererFactory2);
304+
305+
private document = inject(DOCUMENT);
306+
304307
/**
305308
* @hidden
306309
*/
307-
constructor(
308-
@Inject(PLATFORM_ID) private platformId: any,
309-
private renderer: Renderer2,
310-
public elm: ElementRef,
311-
private zone: NgZone,
312-
rendererFactory: RendererFactory2,
313-
@Inject(DOCUMENT) document: Document
314-
) {
310+
constructor() {
315311
// Create singleton instance of PointerEventListeners to avoid creating
316312
// multiple instances of the same listener. Pass it a renderer for the
317313
// document to avoid renderer for the host element of this directive
318314
// instance.
319315
this.pointerEventListeners = PointerEventListeners.getInstance(
320-
rendererFactory.createRenderer(document, null),
316+
this.rendererFactory.createRenderer(this.document, null),
321317
zone
322318
);
323319
}
@@ -689,7 +685,7 @@ class PointerEventListeners {
689685

690686
public pointerUp: Observable<PointerEventCoordinate>;
691687

692-
private static instance: PointerEventListeners; // tslint:disable-line
688+
private static instance: PointerEventListeners;
693689

694690
public static getInstance(
695691
renderer: Renderer2,

0 commit comments

Comments
 (0)