container-ioc
Advanced tools
Comparing version
@@ -69,3 +69,3 @@ "use strict"; | ||
const factoryValue = provider.useFactory || provider.useClass; | ||
const isClass = this.isInjectable(factoryValue); | ||
const isClass = !!provider.useClass; | ||
registryData.factory = { | ||
@@ -98,2 +98,8 @@ value: factoryValue, | ||
instantiateWithFactory(factory, traceMessage) { | ||
if (factory.isClass) { | ||
const injectable = this.isInjectable(factory.value); | ||
if (!injectable) { | ||
throw new exceptions_1.ClassNotInjectableError(factory.value.name); | ||
} | ||
} | ||
const injections = factory.inject; | ||
@@ -100,0 +106,0 @@ const resolvedInjections = injections.map(injection => this.resolveInternal(injection.token, traceMessage)); |
@@ -11,3 +11,3 @@ "use strict"; | ||
constructor(constructorName) { | ||
super(`Class ${constructorName} is not injectable`); | ||
super(`Class ${constructorName} is not injectable. Check if it's decorated with @Injectable() decorator`); | ||
} | ||
@@ -14,0 +14,0 @@ } |
{ | ||
"name": "container-ioc", | ||
"version": "1.7.8", | ||
"version": "1.7.9", | ||
"description": "Dependency Injection and Inversion of Control (IoC) container", | ||
@@ -5,0 +5,0 @@ "author": "Alexander Kozlov", |
27644
1.01%423
1.44%