Skip to content

Commit f50aa21

Browse files
committed
angular: remove deprecated use of ComponentFactoryResolver
- Replaced by using ViewContainerRef.createComponent directly with a component. - Enables compatibility with Angular 22 which removes API access to ComponentFactoryResolver
1 parent 31b9a7a commit f50aa21

1 file changed

Lines changed: 1 addition & 5 deletions

File tree

packages/angular/src/library/jsonforms.component.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
*/
2525
import maxBy from 'lodash/maxBy';
2626
import {
27-
ComponentFactoryResolver,
2827
Directive,
2928
Input,
3029
OnInit,
@@ -76,7 +75,6 @@ export class JsonFormsOutlet
7675

7776
constructor(
7877
private viewContainerRef: ViewContainerRef,
79-
private componentFactoryResolver: ComponentFactoryResolver,
8078
private jsonformsService: JsonFormsAngularService
8179
) {
8280
super();
@@ -128,11 +126,9 @@ export class JsonFormsOutlet
128126
bestComponent = renderer.renderer;
129127
}
130128

131-
const componentFactory =
132-
this.componentFactoryResolver.resolveComponentFactory(bestComponent);
133129
this.viewContainerRef.clear();
134130
const currentComponentRef =
135-
this.viewContainerRef.createComponent(componentFactory);
131+
this.viewContainerRef.createComponent(bestComponent);
136132

137133
if (currentComponentRef.instance instanceof JsonFormsBaseRenderer) {
138134
const instance =

0 commit comments

Comments
 (0)