Skip to content

Commit a7b2af4

Browse files
committed
fix: remove ComponentFactoryResolver usage from scenes
`ComponentFactoryResolver` isn't necessary anymore so it can be removed.
1 parent 4b2e2fc commit a7b2af4

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

material.angular.io/scenes/src/app/scene-viewer/scene-viewer.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import {
22
Component,
3-
ComponentFactoryResolver,
43
HostBinding,
54
Input,
65
OnInit,
@@ -46,17 +45,15 @@ export class SceneViewer implements OnInit {
4645

4746
readonly scene = viewChild.required('scene', { read: ViewContainerRef });
4847

49-
constructor(private readonly componentFactoryResolver: ComponentFactoryResolver,
50-
private route: ActivatedRoute,
48+
constructor(private route: ActivatedRoute,
5149
private sanitizer: DomSanitizer) {
5250
this.hueRotation = this.route.snapshot.data['hueRotate'];
5351
this.component = this.route.snapshot.data['scene'];
5452
this.scale = this.route.snapshot.data['scale'];
5553
}
5654

5755
ngOnInit() {
58-
const componentFactory = this.componentFactoryResolver.resolveComponentFactory(this.component);
59-
this.scene().createComponent(componentFactory);
56+
this.scene().createComponent(this.component);
6057
const container = document.querySelector('#scene-content-container') as HTMLElement;
6158
container.style.transform = `scale(${this.scale})`;
6259
container.style.transformOrigin = 'center';

0 commit comments

Comments
 (0)