Skip to content
This repository has been archived by the owner on Feb 10, 2023. It is now read-only.

Commit

Permalink
fix(core): object host ref should return the parentRef as it is alrea…
Browse files Browse the repository at this point in the history
…dy a factorye
  • Loading branch information
nartc committed May 1, 2022
1 parent 3b92afd commit 33a3df9
Show file tree
Hide file tree
Showing 3 changed files with 2,310 additions and 2,143 deletions.
8 changes: 2 additions & 6 deletions libs/core/src/lib/di/object.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,7 @@ export function provideObjectHostRef<TType extends AnyConstructor<any>>(
{
provide: NGT_INSTANCE_HOST_REF,
useFactory: (instance: InstanceType<TType>) => {
return hostFactory
? hostFactory(instance)
: () => instance.parentRef;
return hostFactory ? hostFactory(instance) : instance.parentRef;
},
deps: [subType],
},
Expand All @@ -65,9 +63,7 @@ export function provideObjectHostRef<TType extends AnyConstructor<any>>(
{
provide: NGT_OBJECT_HOST_REF,
useFactory: (instance: InstanceType<TType>) => {
return hostFactory
? hostFactory(instance)
: () => instance.parentRef;
return hostFactory ? hostFactory(instance) : instance.parentRef;
},
deps: [subType],
},
Expand Down
Loading

0 comments on commit 33a3df9

Please sign in to comment.