本文整理汇总了TypeScript中aurelia-framework.Container.instance类的典型用法代码示例。如果您正苦于以下问题:TypeScript Container.instance类的具体用法?TypeScript Container.instance怎么用?TypeScript Container.instance使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Container.instance类的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")}]`
}
示例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);
}
});
};
示例3: beforeEach
beforeEach(() => {
Container.instance = new Container();
dialogService = Container.instance.get(DialogService);
});
示例4: constructor
constructor(serviceName: string) {
this.dataSource = Container.instance.get(DataSource);
this.dataService = this.dataSource.getService(serviceName);
}
示例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;