fix(core): when using forward references on exports array

This commit is contained in:
Micael Levi L. Cavalcante
2024-06-21 08:44:37 -04:00
parent 15cb568e40
commit 136f035d36

View File

@@ -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) {