Skip to content

Commit ea7837e

Browse files
committed
fix: clean up renderer
1 parent 298a6d5 commit ea7837e

File tree

2 files changed

+6
-13
lines changed

2 files changed

+6
-13
lines changed

libs/angular-three/src/lib/canvas.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -227,9 +227,7 @@ export class NgtCanvas extends NgtRxStore<NgtCanvasInputs> implements OnInit, On
227227
],
228228
this.envInjector
229229
);
230-
this.glRef = this.glAnchor.createComponent(this.sceneGraph, {
231-
environmentInjector: this.glEnvInjector,
232-
});
230+
this.glRef = this.glAnchor.createComponent(this.sceneGraph, { environmentInjector: this.glEnvInjector });
233231
this.glRef.changeDetectorRef.detach();
234232
this.setSceneGraphInputs();
235233

libs/angular-three/src/lib/renderer/renderer.ts

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -22,21 +22,16 @@ import { attachThreeChild, kebabToPascal, processThreeEvent, removeThreeChild, S
2222
@Injectable()
2323
export class NgtRendererFactory implements RendererFactory2 {
2424
private readonly delegateRendererFactory = inject(RendererFactory2, { skipSelf: true });
25-
private readonly cdr = inject(ChangeDetectorRef);
26-
private readonly store = inject(NgtStore);
2725
private readonly catalogue = inject(NGT_CATALOGUE);
28-
private readonly compoundPrefixes = inject(NGT_COMPOUND_PREFIXES);
29-
private readonly document = inject(DOCUMENT);
3026

3127
private rendererMap = new Map<string, Renderer2>();
3228
private routedSet = new Set<string>();
33-
private portals: NgtRendererNode[] = [];
3429
private rendererStore = new NgtRendererStore({
35-
store: this.store,
36-
cdr: this.cdr,
37-
portals: this.portals,
38-
compoundPrefixes: this.compoundPrefixes,
39-
document: this.document,
30+
store: inject(NgtStore),
31+
cdr: inject(ChangeDetectorRef),
32+
portals: [],
33+
compoundPrefixes: inject(NGT_COMPOUND_PREFIXES),
34+
document: inject(DOCUMENT),
4035
});
4136

4237
createRenderer(hostElement: any, type: RendererType2 | null): Renderer2 {

0 commit comments

Comments
 (0)