diff --git a/lib/src/core/injection.dart b/lib/src/core/injection.dart index 9eb26d66..2e7ed073 100644 --- a/lib/src/core/injection.dart +++ b/lib/src/core/injection.dart @@ -68,12 +68,13 @@ resolveInjection(requirement, InjectionRequest injection, RequestContext req, } else if (requirement is Type && requirement != dynamic) { try { var futureType = container.reflector.reflectFutureOf(requirement); - return await container.make(futureType.reflectedType); + if (container.has(futureType.reflectedType)) + return await container.make(futureType.reflectedType); } on UnsupportedError { - // Ignore this; it just means that the reflector doesn't support futures. + // Ignore. } - return container.make(requirement); + return await container.make(requirement); } else if (throwOnUnresolved) { throw new ArgumentError( '$requirement cannot be injected into a request handler.'); diff --git a/pubspec.yaml b/pubspec.yaml index e092d03b..3ad3dc10 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -6,7 +6,7 @@ homepage: https://github.com/angel-dart/angel_framework environment: sdk: ">=2.0.0-dev <3.0.0" dependencies: - angel_container: ^1.0.0-alpha + angel_container: ^1.0.4 angel_http_exception: ^1.0.0 angel_model: ^1.0.0 angel_route: ^3.0.0