Skip to content

Commit

Permalink
fix(core): when using forward references on exports array
Browse files Browse the repository at this point in the history
  • Loading branch information
micalevisk committed Jun 21, 2024
1 parent 15cb568 commit 136f035
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions packages/core/scanner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -522,10 +522,14 @@ export class DependenciesScanner {
}

public insertExportedProvider(
exportedProvider: Type<Injectable>,
// TODO: improve the type definition bellow because it doesn't reflects the real usage of this method
exportedProvider: Type<Injectable> | ForwardReference,
token: string,
) {
this.container.addExportedProvider(exportedProvider, token);
const fulfilledProvider = this.isForwardReference(exportedProvider)
? exportedProvider.forwardRef()
: exportedProvider;
this.container.addExportedProvider(fulfilledProvider, token);
}

public insertController(controller: Type<Controller>, token: string) {
Expand Down

0 comments on commit 136f035

Please sign in to comment.