safety commit before system upgrade

This commit is contained in:
peter
2020-01-30 15:22:05 +01:00
parent 78ad241526
commit f7f770a40c
36 changed files with 651 additions and 125 deletions
+3 -3
View File
@@ -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
})
+3 -3
View File
@@ -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
}
}