59
This commit is contained in:
parent
fbd26eb448
commit
7586b4c58e
4 changed files with 5 additions and 7 deletions
|
@ -1,6 +1,6 @@
|
||||||
# angel_framework
|
# angel_framework
|
||||||
|
|
||||||
[![pub 1.0.0-dev.58](https://img.shields.io/badge/pub-1.0.0--dev.58-red.svg)](https://pub.dartlang.org/packages/angel_framework)
|
[![pub 1.0.0-dev.59](https://img.shields.io/badge/pub-1.0.0--dev.59-red.svg)](https://pub.dartlang.org/packages/angel_framework)
|
||||||
[![build status](https://travis-ci.org/angel-dart/framework.svg)](https://travis-ci.org/angel-dart/framework)
|
[![build status](https://travis-ci.org/angel-dart/framework.svg)](https://travis-ci.org/angel-dart/framework)
|
||||||
|
|
||||||
Core libraries for the Angel Framework.
|
Core libraries for the Angel Framework.
|
||||||
|
|
|
@ -103,7 +103,7 @@ class RequestContext extends Extensible {
|
||||||
/// Grabs an object by key or type from [params], [injections], or
|
/// Grabs an object by key or type from [params], [injections], or
|
||||||
/// [app].container. Use this to perform dependency injection
|
/// [app].container. Use this to perform dependency injection
|
||||||
/// within a service hook.
|
/// within a service hook.
|
||||||
grab(key) {
|
T grab<T>(key) {
|
||||||
if (params.containsKey(key))
|
if (params.containsKey(key))
|
||||||
return params[key];
|
return params[key];
|
||||||
else if (injections.containsKey(key))
|
else if (injections.containsKey(key))
|
||||||
|
|
|
@ -27,9 +27,6 @@ typedef Future AngelErrorHandler(
|
||||||
/// A function that configures an [Angel] server in some way.
|
/// A function that configures an [Angel] server in some way.
|
||||||
typedef Future AngelConfigurer(Angel app);
|
typedef Future AngelConfigurer(Angel app);
|
||||||
|
|
||||||
/// A function that takes no parameters.
|
|
||||||
typedef ParameterlessFunction();
|
|
||||||
|
|
||||||
/// A powerful real-time/REST/MVC server class.
|
/// A powerful real-time/REST/MVC server class.
|
||||||
class Angel extends AngelBase {
|
class Angel extends AngelBase {
|
||||||
StreamController<HttpRequest> _afterProcessed =
|
StreamController<HttpRequest> _afterProcessed =
|
||||||
|
@ -491,10 +488,11 @@ class Angel extends AngelBase {
|
||||||
/// Predetermines what needs to be injected for a handler to run.
|
/// Predetermines what needs to be injected for a handler to run.
|
||||||
InjectionRequest preInject(Function handler) {
|
InjectionRequest preInject(Function handler) {
|
||||||
var injection = new InjectionRequest();
|
var injection = new InjectionRequest();
|
||||||
if (handler is ParameterlessFunction) return injection;
|
|
||||||
|
|
||||||
ClosureMirror closureMirror = reflect(handler);
|
ClosureMirror closureMirror = reflect(handler);
|
||||||
|
|
||||||
|
if (closureMirror.function.parameters.isEmpty) return injection;
|
||||||
|
|
||||||
// Load parameters
|
// Load parameters
|
||||||
for (var parameter in closureMirror.function.parameters) {
|
for (var parameter in closureMirror.function.parameters) {
|
||||||
var name = MirrorSystem.getName(parameter.simpleName);
|
var name = MirrorSystem.getName(parameter.simpleName);
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
name: angel_framework
|
name: angel_framework
|
||||||
version: 1.0.0-dev.58
|
version: 1.0.0-dev.59
|
||||||
description: Core libraries for the Angel framework.
|
description: Core libraries for the Angel framework.
|
||||||
author: Tobe O <thosakwe@gmail.com>
|
author: Tobe O <thosakwe@gmail.com>
|
||||||
homepage: https://github.com/angel-dart/angel_framework
|
homepage: https://github.com/angel-dart/angel_framework
|
||||||
|
|
Loading…
Reference in a new issue