This commit is contained in:
peter
2020-02-05 17:04:10 +01:00
parent afbf1cc001
commit 5cf7a25e77
75 changed files with 2244 additions and 758 deletions
+1 -3
View File
@@ -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 -6
View File
@@ -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
}
}