refactor(injector): use @CONST to create the Inject annotation

This commit is contained in:
vsavkin 2014-10-03 20:34:37 -04:00
parent f63a5dd158
commit a814d48bbc
5 changed files with 12 additions and 21 deletions

View File

@ -1,7 +1,8 @@
//TODO: vsavkin: uncomment once const constructor are supported
//export class Inject {
// @CONST
// constructor(token){
// this.token = token;
// }
//}
import {CONST} from "facade/lang";
export class Inject {
@CONST()
constructor(token){
this.token = token;
}
}

View File

@ -1,6 +1,6 @@
import {Type} from 'facade/lang';
import {List, MapWrapper, ListWrapper} from 'facade/collection';
import {Reflector} from 'facade/di/reflector';
import {Reflector} from './reflector';
import {Key} from './key';
export class Binding {

View File

@ -1,5 +1,5 @@
export * from './annotations';
export * from './injector';
export * from './binding';
export * from './key';
export * from './module';
export {Inject} from 'facade/di/reflector';

View File

@ -1,11 +1,7 @@
library facade.di.reflector;
import 'dart:mirrors';
class Inject {
final Object token;
const Inject(this.token);
}
import 'annotations.dart' show Inject;
class Reflector {
factoryFor(Type type) {

View File

@ -1,11 +1,5 @@
import {Type} from 'facade/lang';
//TODO: vsvakin: remove when const constructors are implemented
export class Inject {
constructor(token){
this.token = token;
}
}
import {Inject} from './annotations';
export class Reflector {
factoryFor(type:Type) {