Skip to content

Commit

Permalink
fix: 修复 Angular 组件内部无法使用外部服务的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
Eve-Sama committed Apr 18, 2024
1 parent 8e2e2b1 commit 3ff0ddc
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/x6-angular-shape/src/view.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,9 @@ export class AngularShapeView extends NodeView<AngularShape> {
this.setInstanceInput(content, embeddedViewRef),
)
} else {
const componentRef = viewContainerRef.createComponent(content)
const componentRef = viewContainerRef.createComponent(content, {
injector,
})
const insertNode = (componentRef.hostView as EmbeddedViewRef<any>)
.rootNodes[0] as HTMLElement
container.appendChild(insertNode)
Expand Down

0 comments on commit 3ff0ddc

Please sign in to comment.