work
This commit is contained in:
@@ -51,8 +51,6 @@ export const Injector = new class {
|
||||
return rootobj
|
||||
}
|
||||
this.moduleObjs[target.name] = new target()
|
||||
return this.moduleObjs[target.name] as any
|
||||
|
||||
|
||||
return this.moduleObjs[target.name] as any
|
||||
}
|
||||
};
|
||||
|
||||
@@ -6,10 +6,10 @@ import { FrontworkComponent } from "../Types/FrontworkComponent";
|
||||
* @returns {GenericClassDecorator<Type<any>>}
|
||||
* @constructor
|
||||
*/
|
||||
export const Module = (ifc?: Type<any>) : GenericClassDecorator<Type<any>> => {
|
||||
export const Injectable = (_interface?: Type<any>) : GenericClassDecorator<Type<any>> => {
|
||||
return (target: Type<any>) => {
|
||||
Injector.modules.push({
|
||||
implements: ifc,
|
||||
implements: _interface,
|
||||
implementation: target
|
||||
})
|
||||
}
|
||||
@@ -20,12 +20,12 @@ export const Module = (ifc?: Type<any>) : GenericClassDecorator<Type<any>> => {
|
||||
* @constructor
|
||||
*/
|
||||
export const RootComponent = (config : {
|
||||
implements : Type<any>
|
||||
imports : Type<FrontworkComponent>[]
|
||||
injectable : Type<any>
|
||||
injects : Type<FrontworkComponent>[]
|
||||
}) : GenericClassDecorator<Type<any>> => {
|
||||
return (target: Type<any>) => {
|
||||
Injector.rootModules = config.imports
|
||||
Injector.rootInterface = config.implements
|
||||
Injector.rootModules = config.injects
|
||||
Injector.rootInterface = config.injectable
|
||||
Injector.root = target
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user