first commit
This commit is contained in:
14
src/core/annotation/ioc.annotation.ts
Normal file
14
src/core/annotation/ioc.annotation.ts
Normal file
@@ -0,0 +1,14 @@
|
||||
/*
|
||||
* Copyright (c) 2020. bmy
|
||||
*/
|
||||
|
||||
export function Autowired(params?: any) {
|
||||
return (target: any, propertyKey: string) => {
|
||||
let typeClass = Reflect.getMetadata('design:type', target, propertyKey);
|
||||
Object.defineProperty(target, propertyKey, {
|
||||
value: params ? new typeClass(new params) : new typeClass(),
|
||||
writable: true,
|
||||
configurable: true
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user