Improved DI
This commit is contained in:
parent
35a0fedb2e
commit
bdcd9e2513
2 changed files with 3 additions and 3 deletions
|
@ -242,7 +242,7 @@ class Angel extends AngelBase {
|
|||
}
|
||||
|
||||
// Run a function after injecting from service container
|
||||
Future runContained(Function handler, RequestContext req, ResponseContext res) async {
|
||||
Future runContained(Function handler, RequestContext req, ResponseContext res, {Map<String, dynamic> namedParameters, Map<Type, dynamic> injecting}) async {
|
||||
ClosureMirror closureMirror = reflect(handler);
|
||||
List args = [];
|
||||
|
||||
|
@ -254,7 +254,7 @@ class Angel extends AngelBase {
|
|||
else {
|
||||
// First, search to see if we can map this to a type
|
||||
if (parameter.type.reflectedType != dynamic) {
|
||||
args.add(container.make(parameter.type.reflectedType));
|
||||
args.add(container.make(parameter.type.reflectedType, namedParameters: namedParameters, injecting: injecting));
|
||||
} else {
|
||||
String name = MirrorSystem.getName(parameter.simpleName);
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
name: angel_framework
|
||||
version: 1.0.0-dev.17
|
||||
version: 1.0.0-dev.18
|
||||
description: Core libraries for the Angel framework.
|
||||
author: Tobe O <thosakwe@gmail.com>
|
||||
homepage: https://github.com/angel-dart/angel_framework
|
||||
|
|
Loading…
Reference in a new issue