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


TypeScript Injector.get方法代碼示例

本文整理匯總了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);
  });
開發者ID:robertrypula,項目名稱:AudioNetwork,代碼行數:13,代碼來源:signal.spec.ts

示例2: 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

示例3: 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

示例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);
  });
開發者ID:robertrypula,項目名稱:AudioNetwork,代碼行數:11,代碼來源:complex.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);
    simpleMath = injector.get(SIMPLE_MATH);
  });
開發者ID:robertrypula,項目名稱:AudioNetwork,代碼行數:6,代碼來源:simple-math.spec.ts


注:本文中的rr-tsdi.Injector.get方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。