Skip to content

Commit 74aafc5

Browse files
fix(core): fix resolve for factories and string tokens
1 parent 74d3f57 commit 74aafc5

2 files changed

Lines changed: 6 additions & 3 deletions

File tree

packages/core/injector/injector.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -662,10 +662,12 @@ export class Injector {
662662
module: Module,
663663
collection: Map<string, InstanceWrapper>,
664664
ctx: ContextId,
665+
wrapper?: InstanceWrapper,
665666
): Promise<T> {
666-
const wrapper = collection.get(
667-
instance.constructor && instance.constructor.name,
668-
);
667+
if (!wrapper) {
668+
const ctor = instance.constructor;
669+
wrapper = collection.get(ctor && ctor.name);
670+
}
669671
await this.loadInstance(wrapper, collection, module, ctx, wrapper);
670672
await this.loadEnhancersPerContext(wrapper, ctx, wrapper);
671673

packages/core/injector/module-ref.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ export abstract class ModuleRef {
100100
wrapper.host,
101101
collection,
102102
contextId,
103+
wrapper,
103104
);
104105
if (!instance) {
105106
throw new UnknownElementException();

0 commit comments

Comments
 (0)