-
Notifications
You must be signed in to change notification settings - Fork 8
Open
Description
需求
import { Injectable, ScopeEnum } from "@artus/injection";
@Injectable({
id: 'foo',
scope: ScopeEnum.EXECUTION
})
export class Foo {
#name: string;
constructor(name: string) {
this.#name = name;
}
say() {
console.log(this.#name);
}
}
每个 Execution 生命周期中实例化Foo
时如何通过 container 传入构造函数需要的参数,比如:
import { Inject } from "@artus/injection";
export class Bar {
@Inject('foo')
private foo;
say() {
this.foo.say();
}
}
Metadata
Metadata
Assignees
Labels
No labels