safety commit before system upgrade
This commit is contained in:
@@ -13,7 +13,7 @@ export const Injector = new class {
|
||||
rootInterface : Type<any>
|
||||
root : Type<any>
|
||||
rootModules: Type<any>[] = []
|
||||
modules : {ifc?: Type<any>, implementation: Type<any>}[] = []
|
||||
modules : {implements?: Type<any>, implementation: Type<any>}[] = []
|
||||
|
||||
moduleObjs : {[key in string] : FrontworkComponent} = {}
|
||||
|
||||
@@ -31,8 +31,8 @@ export const Injector = new class {
|
||||
if(target.name === this.rootInterface.name || target.name === this.root.name){
|
||||
let modules = this.modules.map(m => {
|
||||
const module = new m.implementation()
|
||||
if(m.ifc)
|
||||
this.moduleObjs[m.ifc.name] = module
|
||||
if(m.implements)
|
||||
this.moduleObjs[m.implements.name] = module
|
||||
this.moduleObjs[m.implementation.name] = module
|
||||
return module
|
||||
})
|
||||
|
||||
@@ -9,7 +9,7 @@ import { FrontworkComponent } from "../Types/FrontworkComponent";
|
||||
export const Module = (ifc?: Type<any>) : GenericClassDecorator<Type<any>> => {
|
||||
return (target: Type<any>) => {
|
||||
Injector.modules.push({
|
||||
ifc: ifc,
|
||||
extends: ifc,
|
||||
implementation: target
|
||||
})
|
||||
}
|
||||
@@ -20,12 +20,12 @@ export const Module = (ifc?: Type<any>) : GenericClassDecorator<Type<any>> => {
|
||||
* @constructor
|
||||
*/
|
||||
export const RootComponent = (config : {
|
||||
rootInterface : Type<any>
|
||||
implements : Type<any>
|
||||
imports : Type<FrontworkComponent>[]
|
||||
}) : GenericClassDecorator<Type<any>> => {
|
||||
return (target: Type<any>) => {
|
||||
Injector.rootModules = config.imports
|
||||
Injector.rootInterface = config.rootInterface
|
||||
Injector.rootInterface = config.implements
|
||||
Injector.root = target
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user