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


TypeScript Container.instance.get方法代碼示例

本文整理匯總了TypeScript中aurelia-framework.Container.instance.get方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript Container.instance.get方法的具體用法?TypeScript Container.instance.get怎麽用?TypeScript Container.instance.get使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在aurelia-framework.Container.instance的用法示例。


在下文中一共展示了Container.instance.get方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。

示例1: parseInt

    func: (days: RegExpExecArray, word: string) => {
      const first: string = days[1]
      const second = days[2]
      const firstPrefix = first.substr(0, 1)
      const firstLen = parseInt(first.substr(1), 10)
      let from = moment()
      if (firstPrefix === "-") {
        from.subtract(firstLen, 'days')
      } else {
        from.add(firstLen,'days')
      }
      let until = moment()
      if (second) {
        const secPrefix = second.substr(0, 1)
        const secLen = parseInt(second.substr(1), 10)
        if (secPrefix === "-") {
          until.subtract(secLen, 'days')
        } else {
          until.add(secLen, 'days')
        }
      } else {
        until = from.clone()
        from = moment()
      }

      const ds: DataSource = Container.instance.get(DataSource)
      const aufService = ds.getService('auf')
      const we: WebelexisEvents = Container.instance.get(WebelexisEvents)
      const bm: BriefManager = Container.instance.get(BriefManager)
      const pat = we.getSelectedItem('patient')
      const fall = we.getSelectedItem('fall')
      const dbformat = "YYYYMMDD"
      const today = moment().format(dbformat)
      const auftemplate = {
        patientid: pat.id,
        fallid: (fall ? fall.id : undefined),
        prozent: "100",
        datumvon: from.format(dbformat),
        datumbis: until.format(dbformat),
        grund: (fall ? fall.grund : undefined ),
        aufzusatz: "",
        briefid: undefined,
        datumauz: today
      }
      aufService.create(auftemplate).then(created => {
        created.type = "auf"
        we.selectItem(created)
        // console.log("ok")
      })
      return `[AUF vom ${from.format("DD.MM.YYYY")} bis zum ${until.format("DD.MM.YYYY")}]`
    }
開發者ID:rgwch,項目名稱:webelexis,代碼行數:51,代碼來源:macrodefs.ts

示例2: function

    descriptor.value = function(...args) {
      let transformed;

      if (transformer) {
        transformed = transformer.apply(this, args);
      }

      let dialogService = Container.instance.get(DialogService);

      return dialogService.open({ viewModel: modalClass, model: transformed, options: options })
      .then(response => {
        if (!response.wasCancelled) {
          return ptr.call(this, response.output);
        }
      });
    };
開發者ID:Thanood,項目名稱:monterey,代碼行數:16,代碼來源:decorators.ts

示例3: beforeEach

 beforeEach(() => {
   Container.instance = new Container();
   dialogService = Container.instance.get(DialogService);
 });
開發者ID:Thanood,項目名稱:monterey,代碼行數:4,代碼來源:decorators.spec.ts

示例4: constructor

 constructor(serviceName: string) {
   this.dataSource = Container.instance.get(DataSource);
   this.dataService = this.dataSource.getService(serviceName);
 }
開發者ID:rgwch,項目名稱:webelexis,代碼行數:4,代碼來源:object-manager.ts

示例5:

/********************************************
 * This file is part of Webelexis           *
 * Copyright (c) 2016-2019 by G. Weirich    *
 * License and Terms see LICENSE            *
 ********************************************/
import { DateTime } from "./../services/datetime";
import { CaseType } from "./case";
import { PatientType } from "./patient";
import { KontaktType } from "./kontakt";
import { autoinject, Container } from "aurelia-framework";
import { DataSource, DataService } from "../services/datasource";
import { I18N } from "aurelia-i18n";
import { ElexisType, UUID } from "./elexistype";
import { ObjectManager } from "./object-manager";

const i18 = Container.instance.get(I18N);
/**
 * An Elexis "Fall"
 */
export interface CaseType extends ElexisType {
  garantid: UUID;
  patientid: UUID;
  kostentrid: UUID;
  bezeichnung: string;
  grund: "Krankheit" | "Unfall" | "Mutterschaft";
  gesetz: string;
  datumvon: string;
  datumbis?: string;
  extinfo?: any;
  extjson?: any;
  _Patient?: PatientType;
開發者ID:rgwch,項目名稱:webelexis,代碼行數:31,代碼來源:case.ts


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