本文整理汇总了TypeScript中rr-tsdi.Injector类的典型用法代码示例。如果您正苦于以下问题:TypeScript Injector类的具体用法?TypeScript Injector怎么用?TypeScript Injector使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Injector类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的TypeScript代码示例。
示例1: beforeEach
beforeEach(() => {
const injector = new Injector();
injector.registerService(SIMPLE_MATH, SimpleMath);
injector.registerService(LIST_FACTORY, ListFactory);
listFactory = injector.get(LIST_FACTORY);
});
开发者ID:robertrypula,项目名称:AudioNetwork,代码行数:7,代码来源:list-factory.spec.ts
示例2: beforeEach
beforeEach(() => {
const injector = new Injector();
injector.registerService(SIMPLE_MATH, SimpleMath);
simpleMath = injector.get(SIMPLE_MATH);
list = new List<number>(simpleMath, SIZE_MAX);
});
开发者ID:robertrypula,项目名称:AudioNetwork,代码行数:8,代码来源:list.spec.ts
示例3: 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);
});
开发者ID:robertrypula,项目名称:AudioNetwork,代码行数:11,代码来源:complex.spec.ts
示例4: beforeEach
beforeEach(() => {
const injector = new Injector();
injector.registerService(COMPLEX_DEPENDENCY_BAG, ComplexDependencyBag);
injector.registerValue(PRECISION_DIGITS, precisionDigits);
injector.registerService(SIMPLE_MATH, SimpleMath);
injector.registerService(COMPLEX_FACTORY, ComplexFactory);
injector.registerService(LIST_FACTORY, ListFactory);
injector.registerService(SIGNAL_FACTORY, SignalFactory);
injector.registerService(FOURIER_TRANSFORM, FftDitRecursive);
fft = injector.get(FOURIER_TRANSFORM);
signalFactory = injector.get(SIGNAL_FACTORY);
});
开发者ID:robertrypula,项目名称:AudioNetwork,代码行数:14,代码来源:fft-dit-recursive.spec.ts
示例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);
});
开发者ID:robertrypula,项目名称:AudioNetwork,代码行数:14,代码来源:common-module.spec.ts
示例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);
});
开发者ID:robertrypula,项目名称:AudioNetwork,代码行数:15,代码来源:complex-dependency-bag.spec.ts
示例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);
});
开发者ID:robertrypula,项目名称:AudioNetwork,代码行数:20,代码来源:dsp-module.spec.ts
示例8: beforeEach
beforeEach(() => {
const injector = new Injector();
injector.registerService(SIMPLE_MATH, SimpleMath);
injector.registerService(COMPLEX_FACTORY, ComplexFactory);
injector.registerService(COMPLEX_DEPENDENCY_BAG, ComplexDependencyBag);
injector.registerValue(PRECISION_DIGITS, precisionDigits);
complexFactory = injector.get(COMPLEX_FACTORY);
});
开发者ID:robertrypula,项目名称:AudioNetwork,代码行数:10,代码来源:complex-factory.spec.ts
示例9: beforeEach
beforeEach(() => {
const injector = new Injector();
injector.registerService(SIMPLE_MATH, SimpleMath);
simpleMath = injector.get(SIMPLE_MATH);
});
开发者ID:robertrypula,项目名称:AudioNetwork,代码行数:6,代码来源:simple-math.spec.ts
示例10: Injector
import { COMPLEX_DEPENDENCY_BAG, COMPLEX_FACTORY } from './dsp/complex/di-token';
import { DSP_MODULE } from './dsp/di-token';
import { FOURIER_TRANSFORM } from './dsp/fourier-transform/di-token';
import { SIGNAL_FACTORY } from './dsp/signal/di-token';
import { CommonModule } from './common/common-module';
import { ListFactory } from './common/list/list-factory';
import { SimpleMath } from './common/simple-math/simple-math';
import { ComplexDependencyBag } from './dsp/complex/complex-dependency-bag';
import { ComplexFactory } from './dsp/complex/complex-factory';
import { DspModule } from './dsp/dsp-module';
import { FftDitRecursive } from './dsp/fourier-transform/fft-dit-recursive/fft-dit-recursive';
import { SignalFactory } from './dsp/signal/signal-factory';
import { precisionDigits } from './settings';
const injector = new Injector();
injector.registerValue(PRECISION_DIGITS, precisionDigits);
injector.registerService(LIST_FACTORY, ListFactory);
injector.registerService(SIMPLE_MATH, SimpleMath);
injector.registerService(COMMON_MODULE, CommonModule);
injector.registerService(COMPLEX_DEPENDENCY_BAG, ComplexDependencyBag);
injector.registerService(COMPLEX_FACTORY, ComplexFactory);
injector.registerService(SIGNAL_FACTORY, SignalFactory);
injector.registerService(FOURIER_TRANSFORM, FftDitRecursive);
injector.registerService(DSP_MODULE, DspModule);
export default injector;
开发者ID:robertrypula,项目名称:AudioNetwork,代码行数:30,代码来源:dependency-injection.config.ts
注:本文中的rr-tsdi.Injector类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论