本文整理汇总了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);
});