typeorm-typedi-extensions icon indicating copy to clipboard operation
typeorm-typedi-extensions copied to clipboard

Container Set

Open sgentile opened this issue 3 years ago • 2 comments

I'm setting that container set is not exposed - is there a reason ? Or is there a different approach ? I have a few edge case scenarios where I need to use set.

sgentile avatar Apr 30 '22 12:04 sgentile

Use TypeDi's container set method instead:

import { Container, Token } from 'typedi';

const SOME_INJECTION_TOKEN = new Token<any>('some-name');

Container.set(SOME_INJECTION_TOKEN, <some instance>)

herbola avatar May 02 '22 10:05 herbola

Use TypeDi's container set method instead:

import { Container, Token } from 'typedi';

const SOME_INJECTION_TOKEN = new Token<any>('some-name');

Container.set(SOME_INJECTION_TOKEN, <some instance>)

But according to documentation you should use the Container exported from typeorm-typedi-extensions.

adamalfredsson avatar Oct 10 '22 13:10 adamalfredsson