當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript rr-tsdi.Injector類代碼示例

本文整理匯總了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;未經允許,請勿轉載。