本文整理匯總了TypeScript中rr-tsdi.Injector.get方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript Injector.get方法的具體用法?TypeScript Injector.get怎麽用?TypeScript Injector.get使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類rr-tsdi.Injector
的用法示例。
在下文中一共展示了Injector.get方法的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: beforeEach
beforeEach(() => {
const injector = new Injector();
injector.registerService(COMPLEX_DEPENDENCY_BAG, ComplexDependencyBag);
injector.registerValue(PRECISION_DIGITS, precisionDigits);
injector.registerService(COMPLEX_FACTORY, ComplexFactory);
injector.registerService(SIMPLE_MATH, SimpleMath);
injector.registerService(LIST_FACTORY, ListFactory);
injector.registerService(SIGNAL_FACTORY, SignalFactory);
signalFactory = injector.get(SIGNAL_FACTORY);
complexFactory = injector.get(COMPLEX_FACTORY);
});
示例2: beforeEach
beforeEach(() => {
const injector = new Injector();
injector.registerService(SIMPLE_MATH, SimpleMath);
injector.registerService(LIST_FACTORY, ListFactory);
listFactory = injector.get(LIST_FACTORY);
});
示例3: beforeEach
beforeEach(() => {
const injector = new Injector();
injector.registerService(SIMPLE_MATH, SimpleMath);
simpleMath = injector.get(SIMPLE_MATH);
list = new List<number>(simpleMath, SIZE_MAX);
});
示例4: beforeEach
beforeEach(() => {
const injector = new Injector();
injector.registerService(COMPLEX_DEPENDENCY_BAG, ComplexDependencyBag);
injector.registerService(SIMPLE_MATH, SimpleMath);
injector.registerValue(PRECISION_DIGITS, precisionDigits);
complexDependencyBag = injector.get(COMPLEX_DEPENDENCY_BAG);
complex = new Complex(complexDependencyBag, REAL, IMAGINARY);
});
示例5: it
it('should properly provide all expected items', () => {
const injector = new Injector();
let commonModule: ICommonModule;
injector.registerService(LIST_FACTORY, ListFactory);
injector.registerService(SIMPLE_MATH, SimpleMath);
injector.registerService(COMMON_MODULE, CommonModule);
commonModule = injector.get(COMMON_MODULE);
expect(commonModule).toBeInstanceOf(CommonModule);
expect(commonModule.listFactory).toBeInstanceOf(ListFactory);
expect(commonModule.simpleMath).toBeInstanceOf(SimpleMath);
});
示例6: it
it('should properly provide all expected items', () => {
const injector = new Injector();
let complexDependencyBag: IComplexDependencyBag;
injector.registerService(SIMPLE_MATH, SimpleMath);
injector.registerValue(PRECISION_DIGITS, precisionDigits);
injector.registerService(COMPLEX_DEPENDENCY_BAG, ComplexDependencyBag);
complexDependencyBag = injector.get(COMPLEX_DEPENDENCY_BAG);
expect(complexDependencyBag).toBeInstanceOf(ComplexDependencyBag);
expect(complexDependencyBag.simpleMath).toBeInstanceOf(SimpleMath);
expect(complexDependencyBag.precisionDigits).toBe(precisionDigits);
expect(complexDependencyBag.epsilon).toBe(0.000001);
});
示例7: it
it('should properly provide all expected items', () => {
const injector = new Injector();
let dspModule: IDspModule;
injector.registerService(SIMPLE_MATH, SimpleMath);
injector.registerService(LIST_FACTORY, ListFactory);
injector.registerService(COMPLEX_DEPENDENCY_BAG, ComplexDependencyBag);
injector.registerValue(PRECISION_DIGITS, precisionDigits);
injector.registerService(SIGNAL_FACTORY, SignalFactory);
injector.registerService(COMPLEX_FACTORY, ComplexFactory);
injector.registerService(FOURIER_TRANSFORM, FftDitRecursive);
injector.registerService(DSP_MODULE, DspModule);
dspModule = injector.get(DSP_MODULE);
expect(dspModule).toBeInstanceOf(DspModule);
expect(dspModule.signalFactory).toBeInstanceOf(SignalFactory);
expect(dspModule.complexFactory).toBeInstanceOf(ComplexFactory);
expect(dspModule.fourierTransform).toBeInstanceOf(FftDitRecursive);
});
示例8: beforeEach
beforeEach(() => {
const injector = new Injector();
injector.registerService(SIMPLE_MATH, SimpleMath);
simpleMath = injector.get(SIMPLE_MATH);
});