refactor(injector): use @CONST to create the Inject annotation
This commit is contained in:
parent
f63a5dd158
commit
a814d48bbc
|
@ -1,7 +1,8 @@
|
||||||
//TODO: vsavkin: uncomment once const constructor are supported
|
import {CONST} from "facade/lang";
|
||||||
//export class Inject {
|
|
||||||
// @CONST
|
export class Inject {
|
||||||
// constructor(token){
|
@CONST()
|
||||||
// this.token = token;
|
constructor(token){
|
||||||
// }
|
this.token = token;
|
||||||
//}
|
}
|
||||||
|
}
|
|
@ -1,6 +1,6 @@
|
||||||
import {Type} from 'facade/lang';
|
import {Type} from 'facade/lang';
|
||||||
import {List, MapWrapper, ListWrapper} from 'facade/collection';
|
import {List, MapWrapper, ListWrapper} from 'facade/collection';
|
||||||
import {Reflector} from 'facade/di/reflector';
|
import {Reflector} from './reflector';
|
||||||
import {Key} from './key';
|
import {Key} from './key';
|
||||||
|
|
||||||
export class Binding {
|
export class Binding {
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
|
export * from './annotations';
|
||||||
export * from './injector';
|
export * from './injector';
|
||||||
export * from './binding';
|
export * from './binding';
|
||||||
export * from './key';
|
export * from './key';
|
||||||
export * from './module';
|
export * from './module';
|
||||||
export {Inject} from 'facade/di/reflector';
|
|
||||||
|
|
|
@ -1,11 +1,7 @@
|
||||||
library facade.di.reflector;
|
library facade.di.reflector;
|
||||||
|
|
||||||
import 'dart:mirrors';
|
import 'dart:mirrors';
|
||||||
|
import 'annotations.dart' show Inject;
|
||||||
class Inject {
|
|
||||||
final Object token;
|
|
||||||
const Inject(this.token);
|
|
||||||
}
|
|
||||||
|
|
||||||
class Reflector {
|
class Reflector {
|
||||||
factoryFor(Type type) {
|
factoryFor(Type type) {
|
|
@ -1,11 +1,5 @@
|
||||||
import {Type} from 'facade/lang';
|
import {Type} from 'facade/lang';
|
||||||
|
import {Inject} from './annotations';
|
||||||
//TODO: vsvakin: remove when const constructors are implemented
|
|
||||||
export class Inject {
|
|
||||||
constructor(token){
|
|
||||||
this.token = token;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
export class Reflector {
|
export class Reflector {
|
||||||
factoryFor(type:Type) {
|
factoryFor(type:Type) {
|
Loading…
Reference in New Issue