注入一个常量或者动态值

绑定一个抽象到常量:

container.bind<Katana>("Katana").toConstantValue(new Katana());

绑定一个抽象到动态值:

container.bind<Katana>("Katana").toDynamicValue((context: interfaces.Context) => { return new Katana(); });

results matching ""

    No results matching ""