Skip to content

Commit 6002827

Browse files
committed
flex render run content(props) in injection context
1 parent bc95e00 commit 6002827

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

packages/angular-table/src/flexRender.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ export class FlexRenderDirective<
267267
const content = this.content()
268268
return typeof content === 'string' || typeof content === 'number'
269269
? content
270-
: content?.(this.props())
270+
: runInInjectionContext(this.injector(), () => content?.(this.props()))
271271
}
272272
const ref = this.#viewContainerRef.createEmbeddedView(this.#templateRef, {
273273
get $implicit() {
@@ -313,11 +313,11 @@ export class FlexRenderDirective<
313313
): FlexRenderComponentView {
314314
const instance = flexRenderComponent(component.content, {
315315
inputs: this.props(),
316-
injector: this.#getInjector(this.injector()),
317316
})
317+
const injector = this.#getInjector(instance.injector)
318318
const view = this.#flexRenderComponentFactory.createComponent(
319319
instance,
320-
this.injector(),
320+
injector,
321321
)
322322
return new FlexRenderComponentView(component, view)
323323
}

0 commit comments

Comments
 (0)